View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Nigel[_2_] Nigel[_2_] is offline
external usenet poster
 
Posts: 735
Default Worksheet Codenames Passing to Function

Hi All
I wish to pass a worksheet codename to function. How do I do this?

So far......this fails to pass the codename shAIF to the function

Sub Test
MsgBox FindReport(shAIF, "New Report")
End Sub

Function FindReport(searchSh as Worksheet, searchText as String) as Long
FindReport = 0
Dim c
With xSh
Set c = .Cells.Find(xFind, LookIn:=xlValues)
If Not c Is Nothing Then
FindReport = c.address.Row
End If
End With
End Function

--

Regards,
Nigel