PC Review


Reply
Thread Tools Rate Thread

Create a Month's Sheets automatically

 
 
PumaMan
Guest
Posts: n/a
 
      1st Jun 2009
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 With Quote
 
 
 
 
Patrick Molloy
Guest
Posts: n/a
 
      2nd Jun 2009
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" <(E-Mail Removed)> wrote in message
news:70EABC17-2410-4025-8327-(E-Mail Removed)...
> 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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Create a Month's Sheets automatically Don Guillett Microsoft Excel Programming 0 1st Jun 2009 08:12 PM
Automatically create new sheets... Midget Microsoft Excel Programming 1 28th Apr 2007 03:04 AM
Can I create new sheets automatically in a formula? =?Utf-8?B?R3JlZw==?= Microsoft Excel Worksheet Functions 0 18th Jan 2007 01:00 PM
Hiding Saturday and Sunday from month view (Create Work Month) =?Utf-8?B?UGV0ZXIgQ2hhbg==?= Microsoft Outlook Calendar 1 20th Apr 2006 03:11 AM
have Macro automatically delete and create sheets web_surfer Microsoft Excel Programming 1 28th Mar 2004 05:31 AM


Features
 

Advertising
 

Newsgroups
 


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