PDA

View Full Version : Solved: Add New sheet every day



sathish_fun
08-12-2008, 02:24 AM
Hi

Can anyone help me to add a sheet everyday automatically and sheet name has to change to that particular days date pls help

Regards
Sathishv

Bob Phillips
08-12-2008, 02:58 AM
Private Sub Workbook_Open()
Dim mpSheet As Worksheet

On Error Resume Next
With ThisWorkbook

Set mpSheet = .Worksheets(Format(Date, "yyyymmdd"))
If mpSheet Is Nothing Then

.Worksheets.Add(after:=.Worksheets(.Worksheets.Count)).Name = Format(Date, "yyyymmdd")
End If
End With

End Sub


This is workbook event code.
To input this code, right click on the Excel icon on the worksheet
(or next to the File menu if you maximise your workbooks),
select View Code from the menu, and paste the code