English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have 20 excel files, each has 36 tabs. I need to replace all the tab names ends with '06 to '07. Is there any easy way to do, instead of rename one by one for 720 times? Thank you!

2007-01-22 04:35:54 · 7 answers · asked by wendy y 1 in Computers & Internet Software

I will select to run Macro. I will change the last one number at right end in each tab name. For example, "BudgetJan'06" will be "BudgetJan'07". To be easier, I can just detele the "06", keep the tab name as "BudgetJan". Please help to write macro. Thank U!

2007-01-24 02:19:14 · update #1

7 answers

Run this macro,

Sub rename_tabs()
Dim sht
For Each sht In ActiveWorkbook.Worksheets
If Right(sht.Name, 2) = "06" Then
sht.Name = Right(sht.Name, Len(sht.Name) - 2) & "07"
End If
Next
End Sub

2007-01-22 14:03:01 · answer #1 · answered by unnga 6 · 0 0

Create a macro to do it. I assume they all have the base name? Meaning that in each of the 20 files, the 36 tabs have the same name up to the "06" portion. If so, a simple macro such as the following would do it quickly:

Sub RenameTabs()
'
Sheets("mySheet1-06").Select
Sheets("mySheet1-06").Name = "mySheet1-07"
Sheets("mySheet2-06").Select
Sheets("mySheet2-06").Name = "mySheet2-07"
'
' put the rest here...
Sheets("mySheet36-06").Select
Sheets("mySheet36-06").Name = "mySheet36-07"

End Sub

To create your macro, do the following:
1) Select Tools > Macro > Macros... (or alt-f8)
2) Enter a name such as RenameTabs in the name field and press Create
3) Cut the above function into the opened editor window
4) Select File > Close and return...
5) Press Alt-F8 again, select the macro, and then press run.

You could then expand this macro to open up the other 19 files and do the same thing.

2007-01-22 04:50:35 · answer #2 · answered by BigRez 6 · 1 0

I only know about changing the actual tab individually. When I deal with dates. I always use headers or footers as these can be changed right across the board. I find this easier. I usually don't have any problem with this.

You can include the name of the sheet with date when you print the worksheet. On the View menu, click Header and Footer, and then, in the Page Setup dialog box on the Header/Footer tab, click Custom Header or Custom Footer. In the Left section, Center section, or Right section box, enter the sheet tab by clicking Tab in the row of buttons in the Header or Footer dialog box. Not sure if this can help you or not. Trial and Error, I find.

2007-01-22 04:58:19 · answer #3 · answered by House angel 1 · 0 0

Unfortunately there is not... I was thinking that you could select all sheets and change it that way but I tried it and it doesn't work... Sorry!

EDIT: Macros! Completely forgot about macros! Listen to the guy below me! :-)

2007-01-22 04:47:15 · answer #4 · answered by lover_of_paints_&_quarter_horses 4 · 0 0

For that size of data, you'd be better off using a database rather than a spreadsheet which would make even administrative tasks like the one you raise in your question a lot easier to deal with.

Maybe someone can suggest a script that would do it but not sure....

2007-01-22 04:40:29 · answer #5 · answered by MPatrinos 3 · 0 1

place the cursor the place you're able to like the entire after which you would be able to click on the formulation sign interior the icon gadget bar. click in this and it will automaticly do the formulation for you. or you are able to type =sum(A1:A16) and this could upload up each and all of the suggestions for you. or you are able to type =sum( then click on the 1st cellular you like interior the formulation and drag the mouse down highlighting each and all of the cells you require. Then type ) and hit enter. wish this has helped.

2016-11-26 19:07:55 · answer #6 · answered by ? 4 · 0 0

I don't think that there is a shortcut to do that.

2007-01-22 04:52:28 · answer #7 · answered by Matzah Boy 4 · 0 0

fedest.com, questions and answers