G
Guest
What is this function trying to do...I have added two sheets and not this
function does not complete and Run time error "1004". Application-Defined or
Object-error Defined occues.....help
Function find_range(worksheetcur As Worksheet, criteria As String, rowoffset
As Integer) As Range
Dim check As Range
Dim tmprange As Range
Set check = worksheetcur.Range("A1")
flag = 1
Do While flag = 1
check1 = InStr(check.Value, criteria)
If check1 > 0 Then
Set tmprange = check.Offset(1 + rowoffset, 1)
flag = 0
Else
Set check = check.Offset(0, 1)
flag = 1
End If
Loop
Set find_range = tmprange
End Function
function does not complete and Run time error "1004". Application-Defined or
Object-error Defined occues.....help
Function find_range(worksheetcur As Worksheet, criteria As String, rowoffset
As Integer) As Range
Dim check As Range
Dim tmprange As Range
Set check = worksheetcur.Range("A1")
flag = 1
Do While flag = 1
check1 = InStr(check.Value, criteria)
If check1 > 0 Then
Set tmprange = check.Offset(1 + rowoffset, 1)
flag = 0
Else
Set check = check.Offset(0, 1)
flag = 1
End If
Loop
Set find_range = tmprange
End Function