Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Create a Month's Sheets automatically

I was wondering if there's a procedure to automatically add sheets for the
days in a month automatically? The format just needs the month and day, but
I'd like to be able to do it with VBA.

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Create a Month's Sheets automatically

Option Explicit
Sub AddSheets()
Dim mn As Long
Dim dy As Date
Dim ws As Worksheet
Do
mn = InputBox("Enter Month (0 to quit)")
Loop Until mn = 0 And mn <= 13

If mn = 0 Then Exit Sub

For dy = DateSerial(Year(Date), mn, 1) To DateSerial(Year(Date), mn + 1,
0)
Set ws = Worksheets.Add(after:=Worksheets(Worksheets.Count) )
ws.Name = Format$(dy, "DD_MMM")
Next
End Sub

"PumaMan" wrote in message
...
I was wondering if there's a procedure to automatically add sheets for the
days in a month automatically? The format just needs the month and day,
but
I'd like to be able to do it with VBA.

Thanks!


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
Create a Month's Sheets automatically Don Guillett Excel Programming 0 June 1st 09 08:12 PM
Automatically create new sheets... Midget Excel Programming 1 April 28th 07 03:04 AM
Can I create new sheets automatically in a formula? Greg Excel Worksheet Functions 1 January 18th 07 01:51 PM
Multiple Sheets (Need to create 500 individual sheets in one workbook, pulling DATA Amaxwell Excel Worksheet Functions 4 August 17th 06 06:23 AM
have Macro automatically delete and create sheets web_surfer[_2_] Excel Programming 0 February 27th 04 04:03 AM


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