user3307336
user3307336

Reputation: 1

Macro to create dynamic range with variable rows and columns

Very simple scenario: One spreadsheet where the columns and rows will change every time I update it; the spreadsheet will always begin on A1.

Here is the code I have now that is not working:

Dim LR As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
Range("A1l:BM" & LR).Select

Can you please let me know what needs to be changed so that it will always capture the current region of columns x rows?

Thanks!

Upvotes: 0

Views: 3560

Answers (1)

Netloh
Netloh

Reputation: 4378

If you want to select the entire used range in you sheet, you can simply do it by using:

ActiveSheet.UsedRange.Select

Upvotes: 1

Related Questions