Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default CAN EXCEL AUTO DATE ADDED WORKSHEETS?

I make multiple worksheets for different days of the month. I end up copying
and then renaming. Is there a way to AUTO-FILL the consecutive dates so I
don't have to rename 28-31 sheets?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default CAN EXCEL AUTO DATE ADDED WORKSHEETS?

Start with one sheet which you will copy.

Sub Add_Sheets_Months()
Call AddMonthSheets(6, 2008) 'Adds June 2008 daily sheets
End Sub

Public Sub AddMonthSheets(ByRef Mnth As Integer, ByRef Yr As Integer)
'Chip Pearson code.
Dim wks As Worksheet
Dim dte As Date
Dim lCounter As Long

Set wks = Sheets("Sheet1") 'Sheet to be copied
wks.Select
For lCounter = 1 To 31
dte = DateSerial(Yr, Mnth, lCounter)
If Month(dte) = Mnth And (Weekday(dte) < 1 And _
Weekday(dte) < 7) Then
wks.Copy After:=ActiveSheet
ActiveSheet.Name = Format(DateSerial(Yr, Mnth, lCounter), "Mmm dd ")
End If
Next lCounter

End Sub


Gord Dibben MS Excel MVP

On Fri, 6 Jun 2008 12:58:29 -0700, Dean W. <Dean
wrote:

I make multiple worksheets for different days of the month. I end up copying
and then renaming. Is there a way to AUTO-FILL the consecutive dates so I
don't have to rename 28-31 sheets?


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
auto adjusting for calculation when a row is added [email protected] Excel Discussion (Misc queries) 0 June 1st 08 10:09 PM
how can figures in different worksheets can be added? wadeltayeb Excel Worksheet Functions 0 October 16th 07 09:01 AM
All words and Symbols of keybord should be added to Auto Shapes Parantap Excel Discussion (Misc queries) 1 March 30th 07 04:16 PM
How do i set Excel to record the date etc of info added arrivarob Excel Worksheet Functions 1 March 29th 07 02:23 PM
How can I get auto sum of column when new figures are added Dave New Users to Excel 2 July 18th 06 05:21 PM


All times are GMT +1. The time now is 01:44 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"