View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] transferxxx@gmail.com is offline
external usenet poster
 
Posts: 31
Default Sub Auto_Open() - Sheet name - error code

i new to excel vba - can you give me the complete code which would
leave the workbook unchanged if a sheet already exist with todays date
thxs


wrote:
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