Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XL97 Last Row in column and Range

Status
Not open for further replies.

vaneagle

Technical User
Apr 23, 2003
71
AU
Hi...

I have a worksheet which i copy data from different sheets... No issue there... I use ranges to define what needs to be copied and pasted.. eg
Code:
Range("A1:A15").Select
I am trying to make my code smarter...

In other words, instead of using the range that I have defined, I would like to set the first part of the range ie "a1", but with the second part I would like it to use the last cell in a column with an entry in the cell. IE it would use cell b12 as there is an entry in there for 777-7777.

How do I do this ??

The data looks like the following:

Col A
1 AAA-AAA
2 111-1111
3 222-2222
4 333-3333
5
6 444-4444
7
8 bbb-bbb
9 555-5555
10 666-6666
11 ccc-ccc
12 777-7777
13
14
15


 
Hi vaneagle,

Have you searched the site? There are numerous threads on this topic. This is one way you can do it:

Code:
Range([a1], [a65536].End(xlUp)).Select

Enjoy,
Tony
 
See the FAQs section for at least 2 FAQs on this subject

Rgds, Geoff
Si hoc legere scis, nimis eruditionis habes
Want the best answers to your questions ? - then read me baby one more time - faq222-2244
 
Hi Tony and Geoff...

Yes I have looked at some of the previous posts, but couldn't find exactly what I was after...

Tony, that code you suggested is exactly what I am after.
Thanks for that.....

And I have used one of the posts code to obtain my last row selection....

Paul

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top