Hey guys,
Im not too familar with using range functions, but I'm trying to debug a few macros that has this. When I step through the macro, as I get to the second rFroundCell, where it looks for the string: findStr, I get this error: "type mismatch"
Does this mean that the numbers or strings are not the same? Possibly different cell properties? I've looked into the sheet itself and its just word. I'm sure I am over looking something simple. What do you guys think?
thank you so much!
Function findRowLabor(laborWS As Worksheet, findStr As String) As Range
Dim rFoundCell As Range
Set rFoundCell = Range("U1") 'look for kpiregion and three spaces.
Set rFoundCell = laborWS.Columns(1).find(What:=findStr, After:=rFoundCell, LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False)
If Not rFoundCell Is Nothing Then
Set findRowLabor = rFoundCell
Else
Set findRowLabor = Nothing
End If
End Function
Bookmarks