Macro changing region names

N

Nikki

Hi,

I have a workbook with multiple tabs. All tabs have a defined names region.
For example if a tab is named 401 there is a name in the tab for 401 =
A1:p400. I would like to change the region selection all at once so it will
change to 401= A1:Z400. I would like to use a macro to change regions for all
the tabs rather doing this manually one by one. Your help is truly appreciate
it.

Thanks in advance

Nikki
by one.
 
L

Luke M

No need for a macro, this is relatively easy to change.

First, go to Insert - Name - Paste. Choose to "Paste List".

Second, select the cells containing the formulas, and do a find & replace to
change P400 to Z400.

Finally, select the group of cells with names and formulas, and goto Insert
- Name - Create. Define Name labels as left column. Replace old name
definitions.


If this is something that you would need to do often, you could record this
as a macro, I suppose.
 
M

Mike H

Nikki,

Try this macro

Sub Resize_Ranges()
For x = 1 To Worksheets.Count
Set Rng = Range(Sheets(x).Name)
Rng.Resize(Rng.Rows.Count, 26).Name = Sheets(x).Name
Next
End Sub
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top