Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a workbook that I do not use every day, but when I use it I need to
copy the contents of the last sheet to a new worksheet and then name the new sheet with the current date. What I have now is very simple, since the worksheet I want to copy is always the active sheet I just used the following: ActiveSheet.Copy After:=ActiveSheet Now I want to name the new sheet whatever the current date is. Any ideas? -- Whether you think you can or cannot, you are right. - Henry Ford |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub copysheetandnamedate()
myname = Format(Date, "mm-dd-yy") ActiveSheet.Copy After:=ActiveSheet ActiveSheet.Name = myname End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Jeff Parrott" wrote in message ... I have a workbook that I do not use every day, but when I use it I need to copy the contents of the last sheet to a new worksheet and then name the new sheet with the current date. What I have now is very simple, since the worksheet I want to copy is always the active sheet I just used the following: ActiveSheet.Copy After:=ActiveSheet Now I want to name the new sheet whatever the current date is. Any ideas? -- Whether you think you can or cannot, you are right. - Henry Ford |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub fhjskaf()
ActiveSheet.Name = Format(Date, "mmm_dd_yyyy") End Sub -- Gary''s Student - gsnu200822 "Jeff Parrott" wrote: I have a workbook that I do not use every day, but when I use it I need to copy the contents of the last sheet to a new worksheet and then name the new sheet with the current date. What I have now is very simple, since the worksheet I want to copy is always the active sheet I just used the following: ActiveSheet.Copy After:=ActiveSheet Now I want to name the new sheet whatever the current date is. Any ideas? -- Whether you think you can or cannot, you are right. - Henry Ford |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
After the Activesheet gets copied, the copy now becomes the Activesheet.
ActiveSheet.Copy After:=ActiveSheet ActiveSheet.Name = Format(Date, "mmddyyyy") Gord Dibben MS Excel MVP On Tue, 30 Dec 2008 10:58:05 -0800, Jeff Parrott wrote: I have a workbook that I do not use every day, but when I use it I need to copy the contents of the last sheet to a new worksheet and then name the new sheet with the current date. What I have now is very simple, since the worksheet I want to copy is always the active sheet I just used the following: ActiveSheet.Copy After:=ActiveSheet Now I want to name the new sheet whatever the current date is. Any ideas? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Rename worksheet tab as date not text | Excel Discussion (Misc queries) | |||
Go to current date upon opening Worksheet | Excel Programming | |||
copy worksheet from previous month and rename to current month | Excel Programming | |||
Rename file based on current date | Excel Programming | |||
Rename current sheet | Excel Programming |