Select range First Row to Last Row

sh1pley

Board Regular
Joined
Dec 22, 2006
Messages
160
FirstRow = Range("L1").End(xlDown).Row
FinalRow = Range("L65536").End(xlUp).Row

The range I want select in this case is from B14 to L80. However I do not know how to include "First Row" into the VBA code?

Range("B14:L" & FinalRow).Select
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Perhaps

Code:
Range("B" & FirstRow & ":L" & FinalRow).Select

But why do you need to Select the range to work with it?
 
Upvote 0

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Something like:

Code:
Range("B" & FirstRow & ":L" & FinalRow).Sort Key1:=Range("B" & FirstRow), Order1:=xlAscending, Key2:=Range("C" & FirstRow _
        ), Order2:=xlAscending, Key3:=Range("D" & FirstRow), Order3:=xlAscending, Header _
        :=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

will sort without selecting.
 
Upvote 0

Forum statistics

Threads
1,191,197
Messages
5,985,231
Members
439,951
Latest member
flamingogaslight

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
Top