How to apply changes to many WBs in one go?

M

Metallo

Hi,

I have 11 WBs structured exactly the same way.
Every WB contains 30 WSs, the WSs Tab names are the same for every WB.
I need to change some tab names, which means that I have to reflect all the
changes to the formulas, macros etc.
If I do all of this in one WB, what could be the best way to apply the same
changes to all the other 10 WBs?
Basically, if I change some of the tab names in one WB and fit the formuals
and the macros accordingly, then I will need to do the same job in the other
10 WBs.
I'm asking if there's a short way to this, like for instance a batch process
or so.

Thank you for your help.

Alex
 
T

Tom Ogilvy

If you change a tab name, the formulas should adjust automatically - the
formulas in that workbook that refer to that worksheet.

If other workbooks have formulas that refer to that worksheet, then if they
are open at the time of the change, the formulas in them should adjust as
well.

So it sounds like you just need a macro that loops through your 11 WB's and
renames the tab.

Sub ChangeTab
Dim i as long, varr as Variant
Dim bk as Workbook
vARR = Array("book1.xls", _
"book2.xls", _
. . . , _
"book11.xls")

for i = lbound(varr) to ubound(varr)
set bk = workbooks.open(filename:="C:\MyFolder\" & varr(i))
bk.Worksheets("BadName").Name = "GoodName"
bk.Close SaveChanges:=True
Next
End Sub
 

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