I copied and pasted your code from below in a blank spreadsheet and when I
run it I received the following error: Script out of range.

Please advise.

Thanks![?]

On Wed, Dec 7, 2011 at 7:04 AM, dguillett1 <dguille...@gmail.com> wrote:

>   This macro will copy the template and name each sheet with the start of
> the week (short names better)
> If you want the first MONDAY then change ,7 to ,8
> Option Explicit
> Sub addsheets()
> Dim i As Long
> For i = Day(DateSerial(Year(Date), 1, 7) - _
> WeekDay(DateSerial(Year(Date), 1, 6))) To 365 Step 7
> Sheets("Template").Copy After:=Sheets(Sheets.Count)
> ActiveSheet.Name = _
>   Format(DateSerial(Year(Date), 1, i), "mmm dd")
> Next i
> End Sub
>
>
> ‘=========
> Don Guillett
> SalesAid Software
> dguille...@gmail.com
>
>  *From:* Susan 1 <sunni...@gmail.com>
> *Sent:* Tuesday, December 06, 2011 6:25 PM
> *To:* excel-macros@googlegroups.com
> *Subject:* $$Excel-Macros$$ Formula or macro to add names to sheets in
> one workbook
>
>   Hi,
> I have project at work to create sheets in a workbook , and the sheet
> names are based on 2012 calendar weeks, (I've attached the workboo).
>
> I need to know if there is way to easily add the weeks of the calendar to
> each sheet.
> And Also I don't know how to eliminate the circular reference, after you
> open the workbook.
> Any help is appreciated!
> [?]
>
> Sunnie
> --
> FORUM RULES (934+ members already BANNED for violation)
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will not get quick attention or may not be answered.
>
> 2) Don't post a question in the thread of another member.
>
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
>
> 4) Acknowledge the responses you receive, good or bad.
>
> 5) Cross-promotion of, or links to, forums competitive to this forum in
> signatures are prohibited.
>
> NOTE : Don't ever post personal or confidential data in a workbook. Forum
> owners and members are not responsible for any loss.
>
>
> ------------------------------------------------------------------------------------------------------
> To post to this group, send email to excel-macros@googlegroups.com
>
> --
> FORUM RULES (934+ members already BANNED for violation)
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will not get quick attention or may not be answered.
>
> 2) Don't post a question in the thread of another member.
>
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
>
> 4) Acknowledge the responses you receive, good or bad.
>
> 5) Cross-promotion of, or links to, forums competitive to this forum in
> signatures are prohibited.
>
> NOTE : Don't ever post personal or confidential data in a workbook. Forum
> owners and members are not responsible for any loss.
>
>
> ------------------------------------------------------------------------------------------------------
> To post to this group, send email to excel-macros@googlegroups.com
>

-- 
FORUM RULES (934+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

<<330.gif>>

Reply via email to