Offset or Resize Selection

tesleen2025

New Member
Joined
Nov 23, 2016
Messages
13
Hi,
I have the below code. I need to resize this to exclude the last row. In other words I want to keep all but the last row selected.

Range("A3:B3").Select
Range(Selection, Selection.End(xlDown)).Select


I've tried various offsets and resize combinations and can't seem to get it right.
Hoping someone can help with this.

Thank you,
Tesleen
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Here is one way:
Code:
    Dim lastRow As Long
    lastRow = Range("A3").End(xlDown).Row - 1
    Range("A3:B" & lastRow).Select
 
Upvote 0
Try:
Code:
Range(Selection, Selection.End(xlDown).Offset(-1,0)).Select
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,219
Members
452,619
Latest member
Shiv1198

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