View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Sean Sean is offline
external usenet poster
 
Posts: 454
Default If Sheet Exists Q

Right again Bob! I copied from another piece of code I had and never
copied this

Private Function SheetExists(sname) As Boolean
'from John Walkenbach
Dim x As Object
On Error Resume Next
Set x = ActiveWorkbook.Sheets(sname)
If Err = 0 Then SheetExists = True _
Else SheetExists = False
End Function

Q - How it seems to work (which is not how I want it to work) is If
the sheet exists it just copies to a new sheet and re-names as "log
(2)". What I thought my code did, is take the value of A5 and see if a
sheet name exists of that, if it does exist - show a msb box, if it
does,'t create a new copy sheet called - the value in A5 (in format)
dd-mm-yy.