Home |
Search |
Today's Posts |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Or like that Sub Auto_Open() Dim wk As Worksheet Dim sStr As String sStr = Format(Date, "yyyymmdd") On Error Resume Next Set wk = Worksheets(sStr) On Error GoTo 0 If wk Is Nothing Then Set wk = Worksheets.Add(after:=Worksheets.Count) wk.Name = sStr End If Set wk = Nothing End Sub Regards Jean-Yves wrote in message ps.com... Sub Auto_Open() Dim SH As Worksheet Set SH = Worksheets(Worksheets.Count) Worksheets.Add after:=SH Worksheets(Worksheets.Count).Name = Format(Date, "yyyymmdd") End Sub What additional code do i need to add & where - in order not to get an error message if sheet name already exists when opening file a second time Thxs |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Change Error Messaga from Sheet Code | Excel Programming | |||
Overflow error - same code, different sheet | Excel Programming | |||
Need Code to Set Scaling Zoom in PageSetup in Auto_Open Sub | Excel Programming | |||
Auto_open and environ variable error cannot find library | Excel Programming |