View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Jeff Parrott Jeff Parrott is offline
external usenet poster
 
Posts: 5
Default Rename new worksheet with the current date

Thanks, all of you. I actually sort of used a combination of everything and
came up with:

Sub copysheet()

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

End Sub

It works just like I wanted it to. Thanks!

--
Whether you think you can or cannot, you are right. - Henry Ford


"Leith Ross" wrote:


Hello Jeff,

Once the sheet is copied, it becomes the ActiveSheet. This examples
names the new sheet "31-dec-2008".

Code:
--------------------

ActiveSheet.Copy After:=ActiveSheet
ActiveSheet.Name = Format(Now(), "dd-mmm-yyyy")

--------------------

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.thecodecage.com/forumz/member.php?userid=75
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=45238