VBA Select Active Cells in Column

jerryneubauer

New Member
Joined
Apr 1, 2016
Messages
19
I have a report that has a variable number of rows, depending on the number of transactions returned.

I need to select the active cells in Col. "L", but exclude the last active cell, because it contains the Total for that column.

The data to select in column "L" starts on row 5.

Once I get this line of code, I can apply some Conditional formatting.

Thanks to all.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hello

This line of code will select the range you require, as long as there isnt further data below the total of the column:

Code:
Sub SelectRange()

ActiveSheet.Range("L5:L" & Range("L" & Rows.Count).End(xlUp).Row - 1).Select


End Sub

Caleeco
 
Upvote 0

Forum statistics

Threads
1,216,146
Messages
6,129,142
Members
449,488
Latest member
qh017

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