Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 87
  • Last Modified:

Odd Select Range request. Select cell and XLDown as long as value is in Column B?

I have an odd request.  I need to copy a range from an active sheet that starts at cell A2 and goes down as long as there is a value in column B, but goes out to column K.  Can this be done in Excel vba?  Please advise and thanks.
0
RWayneH
Asked:
RWayneH
  • 2
1 Solution
 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Try like this.....
Dim lr As Long
lr = Cells(Rows.Count, 2).End(xlUp).Row
Range("A2:K" & lr).Copy

Open in new window

0
 
RWayneHAuthor Commented:
Worked perfectly.  Thanks for the help.
0
 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome. Glad to help.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now