Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default How do I increment tabs by date in a workbook?

I have a workbook for each day of the month of June. The name in each tab
will be each day of the month. I don;t want to have to rename each tab. I
should be able to let excel update the tabs. HOW?
--
Roaddog
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default How do I increment tabs by date in a workbook?

Sub NewWorksheet()
Dim i As Integer
on error resume next
For i = 2 To 31
ActiveWorkbook.Worksheets.Add
ActiveSheet.Name = "Jun" & i
Next i
End Sub


--
Don Guillett
SalesAid Software

"Harley" wrote in message
...
I have a workbook for each day of the month of June. The name in each tab
will be each day of the month. I don;t want to have to rename each tab. I
should be able to let excel update the tabs. HOW?
--
Roaddog


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default How do I increment tabs by date in a workbook?

Work backwards to not have to sort
Sub mynewsheets()
on error resume next
For i = 31 To 1 Step -1
On Error Resume Next
Sheets.Add.Name = "Jun" & i
Next i
End Sub


--
Don Guillett
SalesAid Software

"Harley" wrote in message
...
I have a workbook for each day of the month of June. The name in each tab
will be each day of the month. I don;t want to have to rename each tab. I
should be able to let excel update the tabs. HOW?
--
Roaddog


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default How do I increment tabs by date in a workbook?

Harley

Try this code from Chip Pearson.

Sub NameSheets()
'Chip Pearson Feb 14th, 2007
Dim Ndx As Long
Dim StartMonth As Variant
StartMonth = Application.InputBox(Prompt:="Enter the month number.", Type:=1)
If StartMonth = False Then
Exit Sub
End If
For Ndx = 1 To ActiveWorkbook.Worksheets.Count
ActiveWorkbook.Worksheets(Ndx).Name = Format(DateSerial( _
IIf(StartMonth = 1, Year(Now) + 1, Year(Now)), StartMonth, Ndx), _
"dd mmm yyyy")
Next Ndx
End Sub


Gord Dibben MS Excel MVP

On Wed, 27 Jun 2007 11:28:06 -0700, Harley
wrote:

I have a workbook for each day of the month of June. The name in each tab
will be each day of the month. I don;t want to have to rename each tab. I
should be able to let excel update the tabs. HOW?


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
Automatically increment numbers in a cell when you open workbook mrcall Excel Discussion (Misc queries) 2 March 3rd 07 10:26 PM
How to increment the date Tom Excel Discussion (Misc queries) 13 January 1st 07 07:26 AM
Select sheet tabs in workbook & save to separate workbook files stratocaster Excel Worksheet Functions 2 March 1st 06 03:35 PM
Increment Page Numbers for multiple tabs in Excel fxgator Excel Worksheet Functions 0 February 7th 06 08:10 PM
Time and Date increment La La Lara Excel Discussion (Misc queries) 0 January 18th 05 09:59 AM


All times are GMT +1. The time now is 08:23 PM.

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"