Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way to renumber an excel worksheet?
|
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() To rename 5 WorkSheets, for example: Sub RenameWorksheets() shtName = Array("Apple", "Bean", "Cherry", "Diamond", "Earl") For i = 1 To Sheets.Count 'assumes 5 worksheets total Sheets(i).Name = shtName(i - 1) Next End Sub Ht -- Myle ----------------------------------------------------------------------- Myles's Profile: http://www.excelforum.com/member.php...fo&userid=2874 View this thread: http://www.excelforum.com/showthread.php?threadid=49731 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yep, knew that one.. but i want to change the value "Sheet37" (Tools) to
"Sheet5" (Tools)... not "Sheet37" (Tools) to "Sheet37" (bunny) :) "Myles" wrote: To rename 5 WorkSheets, for example: Sub RenameWorksheets() shtName = Array("Apple", "Bean", "Cherry", "Diamond", "Earl") For i = 1 To Sheets.Count 'assumes 5 worksheets total Sheets(i).Name = shtName(i - 1) Next End Sub HtH -- Myles ------------------------------------------------------------------------ Myles's Profile: http://www.excelforum.com/member.php...o&userid=28746 View this thread: http://www.excelforum.com/showthread...hreadid=497319 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub RenameSheets()
Dim aryOld Dim aryNew Dim sh As Worksheet Dim i As Long aryOld = Array("Sheet17", "Sheet21", "Sheet37") aryNew = Array("Sheet1", "Sheet2", "Sheet5") For Each sh In Worksheets For i = LBound(aryOld) To UBound(aryOld) If sh.CodeName = aryOld(i) Then sh.Parent.VBProject.VBComponents(sh.CodeName) _ .Properties("_CodeName") = aryNew(i) Exit For End If Next i Next sh End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Mirco Wilhelm" wrote in message ... Yep, knew that one.. but i want to change the value "Sheet37" (Tools) to "Sheet5" (Tools)... not "Sheet37" (Tools) to "Sheet37" (bunny) :) "Myles" wrote: To rename 5 WorkSheets, for example: Sub RenameWorksheets() shtName = Array("Apple", "Bean", "Cherry", "Diamond", "Earl") For i = 1 To Sheets.Count 'assumes 5 worksheets total Sheets(i).Name = shtName(i - 1) Next End Sub HtH -- Myles ------------------------------------------------------------------------ Myles's Profile: http://www.excelforum.com/member.php...o&userid=28746 View this thread: http://www.excelforum.com/showthread...hreadid=497319 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Another way is to manually change the CodeName property in the VBE tree.
Select the sheet from the tree, then from the main menu, View/Properties Window (or F4). This brings up the properties window of the worksheet. Notice there are 2 places for Name. The one at the top, (Name) is the Code Name. The one further down the list is the name that appears in parentheses on the tree and on the sheet tab. Be careful of creating duplicates. Mike F "Mirco Wilhelm" wrote in message ... Is there a way to renumber an excel worksheet? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need Formula to renumber column | Excel Discussion (Misc queries) | |||
renumber automatically | Excel Worksheet Functions | |||
Upload multiple text files into 1 excel worksheet + put the filename as the first column in the worksheet | Excel Worksheet Functions | |||
how do you renumber column in your excel table | Excel Discussion (Misc queries) | |||
Attaching a JET database to an Excel Worksheet OR storing large binary data in a worksheet | Excel Programming |