Resize all named ranges on a sheet with LastRow

zsnemeth

New Member
Joined
Mar 4, 2015
Messages
36
Hi All,

I would like to resize all the named ranges on a worksheet, where I have about 30 columns next to each other, so the LastRow of them is the same.
This is actually a table, where sometimes a new row will be filled in completely.
That is why I need to enlarge all the named ranges (all names belong to 1-1 column) by 1 row, practically with the "new" LastRow of the table.
The first row of all ranges is always the row nr. 5.

Example:
MyRng_A = "$A$5:$A$" & LastRow
MyRng_B = "$B$5:$B$" & LastRow
MyRng_C = "$C$5:$C$" & LastRow

These examples are simple, but my range names are longer and more difficult, that is why I search for a smarter solution.

So, do I have to type all those commands into the code, or is there an option like "For Each" or so?
I do not know how to do this.

Could anyone please help me?

Thank you very much for your help!

Cheers,
Zs
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
A dynamic range would end at your current last used row.

A range set to the entire column would end at the very last row at the bottom of the sheet.

The two ranges may or may not work the same depending on how you use the named range.

Also, this is a link to a tutorial:
dynamic named ranges
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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