Selection Range (until last filled cell) to the right

cazdealer

Board Regular
Joined
Mar 12, 2011
Messages
96
Hi,
what is the equivalent of this


Range("A1:B" & Range("A1").End(xlDown).Row).Select

but instead of selecting until the last filled cell to the bottom, I what to select until the last cell to the right...

to be more precise,

I want to select from A1 until GS2 (for exemple) ... If my last fill cell is GS1.

thanks
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hello cazdealer,

To find the last column that has a entry use this code. The example is for row 1.
Code:
  Dim LastCol As Long

    LastCol = Cells(1, Columns.Count).End(xlToLeft).Column
Sincerely,
Leith Ross
 
Upvote 0
Hello,

try:

<font face=Courier New>Range("a1", Range("a1").End(xlToRight).Offset(1, 0)).Select</FONT>
 
Upvote 0
Hello cazdealer,

This will select cells in both rows 1 and 2.
Code:
  Range("A1" , Cells(1, Columns.Count).End(xlToLeft)).Resize(1, 2).Select
Sincerely,
Leith Ross
 
Upvote 0

Forum statistics

Threads
1,224,618
Messages
6,179,917
Members
452,949
Latest member
beartooth91

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