View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Find existing worksheet

Hi Rob

One way

Sub test()
Dim N As Long
On Error Resume Next
With ThisWorkbook.Worksheets
N = Len(.Item("'RECORD TYPE THREE").Name)
If N = 0 Then
.Add(after:=.Item(.Count)).Name = "'RECORD TYPE THREE"
End If
End With
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Rob" wrote in message ...
Hi,

Hoping someone can help me.

I am creating a Macro in Excel 2000 and have run across a
problem. I have a file with numerous worksheets but
would like to search for one particular worksheet 'RECORD
TYPE THREE' in the file and if not found then add a new
worksheet with that name. I can add a new one, but do
not know how to search for an existing worksheet by that
name. Any help would be greatly appreciated.

Thanks,
Rob