Worksheet naming

  • Thread starter Thread starter Woodstock
  • Start date Start date
W

Woodstock

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.
 
Date is today's date and format function converts the date to text

ActiveSheet.Name = Format(Date, "mm-dd-yyyy")
 
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)
 
This worked great! Thank you so much!

Chip Pearson said:
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top