Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Renumber a WorkSheet

Is there a way to renumber an excel worksheet?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Renumber a WorkSheet


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Renumber a WorkSheet

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Renumber a WorkSheet

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Renumber a WorkSheet

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Formula to renumber column crj Excel Discussion (Misc queries) 4 March 26th 10 03:17 AM
renumber automatically JICDB Excel Worksheet Functions 3 May 1st 08 02:14 PM
Upload multiple text files into 1 excel worksheet + put the filename as the first column in the worksheet Aster Excel Worksheet Functions 3 March 12th 06 09:58 AM
how do you renumber column in your excel table N Locatis Excel Discussion (Misc queries) 1 March 3rd 06 09:19 PM
Attaching a JET database to an Excel Worksheet OR storing large binary data in a worksheet Ant Waters Excel Programming 1 September 3rd 03 11:34 AM


All times are GMT +1. The time now is 09:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"