Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub AddTopStockWeek1()
Dim N As Long Dim sName As String Dim sNum As String Dim itm As Long With ThisWorkbook.Worksheets For N = .Count To 1 Step -1 sName = .Item(N).Name If LCase(Left(sName, 12)) = "topstockweek" Then sNum = Right(sName, Len(sName) - 12) If sNum = "1" Then itm = N .Item(N).Name = "TopStockWeek" & CLng(sNum) + 1 End If Next N .Add(befo=.Item(itm)).Name = "TopStockWeek1" End With End Sub Should work. -- Regards, Tom Ogilvy "Duncan J" wrote in message ... Thanks Tom, That worked great. Could you do the same for Top Stock out week1 Thanks again. DJ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Chart tabs changing by themself | Charts and Charting in Excel | |||
Run Macro when changing tabs | Excel Discussion (Misc queries) | |||
Changing the size of sheetname tabs | Excel Discussion (Misc queries) | |||
Changing Tabs to Specific Cells | Excel Discussion (Misc queries) | |||
Changing colors of tabs | Excel Discussion (Misc queries) |