View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
kkknie[_80_] kkknie[_80_] is offline
external usenet poster
 
Posts: 1
Default VBA - No Duplicate Sheet

Wedge this code in there somewhere before you rename the sheet.

Dim s
Dim bFound As Boolean

bFound = False
For Each s In Worksheets
If LCase(s.Name) = LCase(strTitle) Then bFound = True
Next

If bFound = True Then
MsgBox "You already have a sheet named " & strTitle & ". More inf
here..."
Exit Sub
End If

'Your normal code here



--
Message posted from http://www.ExcelForum.com