Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Rename new worksheet with the current date

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Rename new worksheet with the current date


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Rename new worksheet with the current date

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Rename new worksheet with the current date

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   Report Post  
Posted to microsoft.public.excel.programming
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


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
Rename worksheet tab as date not text Wanna Learn Excel Discussion (Misc queries) 3 September 10th 07 02:10 PM
Go to current date upon opening Worksheet Jason Excel Programming 6 August 21st 06 01:41 PM
copy worksheet from previous month and rename to current month Dan E. Excel Programming 4 December 8th 05 09:40 PM
Rename file based on current date wira Excel Programming 1 April 29th 05 10:37 AM
Rename current sheet No Name Excel Programming 3 May 20th 04 09:23 PM


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