#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Worksheet naming

Can anyone tell me how to create a worksheet with a name that I will choose
later in a macro. Specifically, I would like to create one worksheet each
day and name it with today's date (i.e. '01-19-09'). I am fairly proficient
with writing macros, but have not seen a way to do this yet. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,510
Default Worksheet naming

Date is today's date and format function converts the date to text

ActiveSheet.Name = Format(Date, "mm-dd-yyyy")

--
Regards,

OssieMac


"Woodstock" wrote:

Can anyone tell me how to create a worksheet with a name that I will choose
later in a macro. Specifically, I would like to create one worksheet each
day and name it with today's date (i.e. '01-19-09'). I am fairly proficient
with writing macros, but have not seen a way to do this yet. Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default Worksheet naming


The following code snippet will create a new worksheet after all the
existing sheets and name it with today's date.


With Worksheets
.Add(after:=.Item(.Count)).Name = Format(Now, "mm-dd-yy")
End With

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Mon, 19 Jan 2009 14:35:01 -0800, Woodstock
wrote:

Can anyone tell me how to create a worksheet with a name that I will choose
later in a macro. Specifically, I would like to create one worksheet each
day and name it with today's date (i.e. '01-19-09'). I am fairly proficient
with writing macros, but have not seen a way to do this yet. Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Worksheet naming

This worked great! Thank you so much!

"Chip Pearson" wrote:


The following code snippet will create a new worksheet after all the
existing sheets and name it with today's date.


With Worksheets
.Add(after:=.Item(.Count)).Name = Format(Now, "mm-dd-yy")
End With

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Mon, 19 Jan 2009 14:35:01 -0800, Woodstock
wrote:

Can anyone tell me how to create a worksheet with a name that I will choose
later in a macro. Specifically, I would like to create one worksheet each
day and name it with today's date (i.e. '01-19-09'). I am fairly proficient
with writing macros, but have not seen a way to do this yet. 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
Worksheet naming with cell info HFM - LEE Excel Worksheet Functions 3 August 9th 07 09:30 PM
Naming Worksheet tabs Scott@CW Excel Discussion (Misc queries) 11 August 2nd 07 08:36 AM
Worksheet Naming Options ComicFly Excel Worksheet Functions 2 January 26th 07 12:37 PM
Naming Worksheet Denis New Users to Excel 2 September 13th 05 05:55 PM
Naming a worksheet help? pauldaddyadams Excel Worksheet Functions 1 August 9th 05 10:46 AM


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