N
Nigel
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
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