Hello! I have a macro that when I press a button I want it to create a new
worksheet. The name of the worksheet shall be the current date. I do not know
exactly how to write this so I would really appreciate some help. Pls help me
with this code! Thank you very much!
Norman Jones - 19 Sep 2006 09:16 GMT
Hi Anne,
Try:
'=============>>
Public Sub Tester()
Dim SH As Worksheet
Set SH = Worksheets.Add(After:=Sheets(Sheets.Count))
SH.Name = Format(Date, "dd-mm-yy")
End Sub
'<<=============
---
Regards,
Norman
> Hello! I have a macro that when I press a button I want it to create a new
> worksheet. The name of the worksheet shall be the current date. I do not
> know
> exactly how to write this so I would really appreciate some help. Pls help
> me
> with this code! Thank you very much!
Bob Phillips - 19 Sep 2006 11:21 GMT
Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = Format(Date,
"dd-mm-yy")

Signature
HTH
Bob Phillips
(replace somewhere in email address with gmail if mailing direct)
> Hello! I have a macro that when I press a button I want it to create a new
> worksheet. The name of the worksheet shall be the current date. I do not know
> exactly how to write this so I would really appreciate some help. Pls help me
> with this code! Thank you very much!