A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

macro to: Add new sheet, then rename new sheet with todays date



 
 
Thread Tools Display Modes
  #1  
Old September 29th 07, 02:33 AM posted to microsoft.public.excel.worksheet.functions
Paul
external usenet poster
 
Posts: 661
Default macro to: Add new sheet, then rename new sheet with todays date

With workbook already open, would like to have a macro perform:
1) add new sheet
2) rename that new sheet with todays date.

Step 1 easy, completed.
Need guidance on step 2


Thanks !
Ads
  #2  
Old September 29th 07, 02:57 AM posted to microsoft.public.excel.worksheet.functions
Paul B[_3_]
external usenet poster
 
Posts: 14
Default macro to: Add new sheet, then rename new sheet with todays date

Paul, something like this,

Worksheets.Add.Name = Format(Date, "mmm dd yy")

Paul B
"Paul" > wrote in message
...
> With workbook already open, would like to have a macro perform:
> 1) add new sheet
> 2) rename that new sheet with todays date.
>
> Step 1 easy, completed.
> Need guidance on step 2
>
>
> Thanks !



  #3  
Old September 29th 07, 03:15 AM posted to microsoft.public.excel.worksheet.functions
Paul
external usenet poster
 
Posts: 661
Default macro to: Add new sheet, then rename new sheet with todays dat

Indeed !! that works, a large Thanks !
"Paul B" wrote:

> Paul, something like this,
>
> Worksheets.Add.Name = Format(Date, "mmm dd yy")
>
> Paul B
> "Paul" > wrote in message
> ...
> > With workbook already open, would like to have a macro perform:
> > 1) add new sheet
> > 2) rename that new sheet with todays date.
> >
> > Step 1 easy, completed.
> > Need guidance on step 2
> >
> >
> > Thanks !

>
>
>

  #4  
Old September 29th 07, 03:17 AM posted to microsoft.public.excel.worksheet.functions
Alan
external usenet poster
 
Posts: 492
Default macro to: Add new sheet, then rename new sheet with todays date

I don't know if you are familiar with VB so,
Hit Alt and F11 to open the VB editor,
Click 'Insert' > 'Module'
In the empty screen cut and paste this into it:-

Sub NewSheet()
On Error GoTo Error
Dim AddSheet
Sheets.Add
AddSheet = Format(Date, "dd mmm yy")
ActiveSheet.Name = AddSheet
Exit Sub
Error:
Application.DisplayAlerts = False
ActiveSheet.Delete
Application.DisplayAlerts = True
MsgBox "A Sheet named " & AddSheet & " already exists."
End Sub

Exit the VB editor,
Click 'Views' > 'Toolbars' > 'Forms' > 'Button' to put a cammand button on
the sheet,
Right click the Button, select 'Assign Macro', click 'NewSheet'
Rename the Button and move it where you want it and there you go,
Regards,
Alan.
"Paul" > wrote in message
...
> With workbook already open, would like to have a macro perform:
> 1) add new sheet
> 2) rename that new sheet with todays date.
>
> Step 1 easy, completed.
> Need guidance on step 2
>
>
> Thanks !


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Move data to new sheet - rename sheet based on criteria ? [email protected] Excel Discussion (Misc queries) 7 May 16th 07 10:22 PM
Rename sheet with NOW date Publius Excel Worksheet Functions 4 January 12th 07 11:05 PM
Create a reference to a sheet that changes to todays date Grd Excel Worksheet Functions 2 August 14th 06 05:36 PM
VBA rename sheet. paulrm906 Excel Discussion (Misc queries) 3 March 12th 06 01:18 PM
Rename Sheet Linda@VZ Excel Discussion (Misc queries) 1 November 2nd 05 01:43 PM


All times are GMT +1. The time now is 09:58 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 2004-2014 ExcelBanter.
The comments are property of their posters.