vba select column down to last entry

Galceran

Board Regular
Joined
Nov 8, 2008
Messages
177
I would like to add to a macro a range so it is ready for copying into HTML-Kit.
The range is A2 down to the last entry in column A. Entries are added daily, after the entry has been made the macro runs to format the worksheet. I want it to select the A2 to the last entry and save.
The only piece I require is the code for the selection.
Thanks
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Try

Code:
Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row).Select
 
Upvote 0
You will probably not need to select, but anyway:

Code:
Range("A2", Range("A" & Rows.Count).End(xlUp)).Select
 
Upvote 0
to get to the last row try

Cells(Rows.Count, 1).End(xlUp).Row

to get to the final column try Cells(1, Columns.Count).End(xlToLeft).Column
 
Upvote 0

Forum statistics

Threads
1,214,576
Messages
6,120,354
Members
448,956
Latest member
Adamsxl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top