Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't understand the point of the loop. It looks like you are changing the
name of the active sheet over and over. You'd have to activate each sheet at the beginning of the code (in order to process every worksheet in the workbook) or change ActiveSheet to Worksheets(x) (and fully qualify the range as Worksheets(x).Range("A1"). A For/Each loop would also work: Dim WkSht As Worksheet For each WkSht in Worksheets WkSht.Name = WkSht.Name & WkSht.Range("A1").Value Next WkSht "Adamaths" wrote: I can't guarantee success but someting along the lines of the below should work: Dim OriginalName as String Dim NewName as String For x = 1 To ThisWorkbook.Worksheets.Count OriginalName=ActiveSheet.Name NewName = OriginalName & Range("A1").Value ActiveSheet.Name = NewName Next x Change the Range("A1") to be the range of whatever the common cell is and if needed change this formula so it puts the original name etc. in a different order. Should work. -- Adamaths ------------------------------------------------------------------------ Adamaths's Profile: http://www.excelforum.com/member.php...o&userid=31580 View this thread: http://www.excelforum.com/showthread...hreadid=512790 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to lookup a sheet, number, then display in origonal sheet | New Users to Excel | |||
Return to Current Sheet in On (sheet activate) event macro | Excel Programming | |||
2 questions, copying data from sheet to sheet and assigning macro | Excel Worksheet Functions | |||
How to create a Macro to Copy Information in one sheet to another sheet. | Excel Programming | |||
excel - macro code to open a protected sheet, enter passowrd, and then protect sheet | Excel Programming |