Solved

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

Posted on 2016-11-03
3
47 Views
Last Modified: 2016-11-03
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
Comment
Question by:RWayneH
  • 2
3 Comments
 
LVL 28

Accepted Solution

by:
Subodh Tiwari (Neeraj) earned 500 total points
ID: 41872849
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
 

Author Closing Comment

by:RWayneH
ID: 41872872
Worked perfectly.  Thanks for the help.
0
 
LVL 28

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41872879
You're welcome. Glad to help.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
My experience with Windows 10 over a one year period and suggestions for smooth operation
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now