Limit Column Data

MR3

Board Regular
Joined
Jun 10, 2008
Messages
175
currently my code searches selects an entire column(s) for conditional formatting if blank cells are there. For example

Columns("A:F").Select

I don't think this is efficient because my data will most likely never get down to the bottom of the worksheet.

I was thinking something along the lines of

LR = Range("A" & Rows.Count).End(xlUp).Row
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Then it would be

Range("A1:F" & LR).Select

although you should not need to select that range in order to work with it.
 
Upvote 0
Then it would be

Range("A1:F" & LR).Select

although you should not need to select that range in order to work with it.

Do you mean I could just put

Range("A1:F" & LR)

and the code will continue without the .Select?
 
Upvote 0
No I didn't mean that. You have to do something with the range. You could select it then operate on the selection but you should be able to work without selecting, for example

Range("A1:F" & LR).Sort ' sort parameters go here
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,763
Members
452,940
Latest member
rootytrip

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