#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 82
Default Sheets Name

I have to do a worksheet where I have to specify data for 2010, one week in
each sheet.

For the sheets name I have to consider a work week, so the sheets name
should be:
Sheet1: 04-01-10 to 08-01-10
Sheet2: 11-01-10 to 15-01-10 and so on

Is there a way to do this automatically?

Thanks in advance.

Regards
Emece.-
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Sheets Name

You can try out the below macro. If you are new to macros..

--Set the Security level to low/medium in (Tools|Macro|Security).
--From workbook launch VBE using short-key Alt+F11.
--From menu 'Insert' a module and paste the below code.
--Get back to Workbook.
--Run macro from Tools|Macro|Run <selected macro()


Sub Macro()
Dim ws As Worksheet, dtStart As Date, intCount As Integer
dtStart = "04-Jan-2010"

For intCount = 1 To 52
Set ws = Worksheets.Add(After:=Worksheets(Worksheets.Count) )
ws.Name = Format(dtStart, "dd-mm-yy") & " to " & _
Format(dtStart + 4, "dd-mm-yy")
dtStart = dtStart + 7
Next

End Sub

--
Jacob


"Emece" wrote:

I have to do a worksheet where I have to specify data for 2010, one week in
each sheet.

For the sheets name I have to consider a work week, so the sheets name
should be:
Sheet1: 04-01-10 to 08-01-10
Sheet2: 11-01-10 to 15-01-10 and so on

Is there a way to do this automatically?

Thanks in advance.

Regards
Emece.-

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
How do I print sheets in Excel without blank sheets after page Peggy New Users to Excel 2 January 12th 08 11:10 AM
Multiple Sheets (Need to create 500 individual sheets in one workbook, pulling DATA Amaxwell Excel Worksheet Functions 4 August 17th 06 06:23 AM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Worksheet Functions 6 March 29th 06 12:43 PM
In 3 active sheets in wkbk, determine& display the # of sheets that have data wrpalmer Excel Discussion (Misc queries) 1 November 4th 05 02:01 PM
populating sheets based on data from parent sheets seve Excel Discussion (Misc queries) 2 January 15th 05 09:22 PM


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