Sub Create_log()
Sheets("Log master").Visible = True
Sheets("Log Master").Copy After:=ActiveSheet
ActiveSheet.Name = format(date,"yyyy_mm_dd")
Sheets("Log Master").Visible = False
End Sub
Remember that worksheet names can't include slashes (/).
(and the second time you run this the same day, it'll blow up!)
Anthony wrote:
Hi,
I have been given the code below which will enable a user to create a new
worksheet from a copy of one stored in my workbook.
What I require is once the new sheet has been created - rename it as todays
date.
ie user clicks on the 'create todays log' button, a copy of my master sheet
is shown and this newly created worksheet is now renamed after todays date.
hope you can help - and go easy as I'm new to this.
many thanks
Sub Create_log()
Sheets("Log master").Visible = True
Sheets("Log Master").Copy After:=ActiveSheet
'ActiveSheet.Name =
Sheets("Log Master").Visible = False
End Sub
--
Dave Peterson
|