E
Enz
I am continuously getting a runtime error, "Error 1004 application-
defined or object-defined error" when using the MATCH function. I
noticed that it occurs only in the second round of the loop. If I
delete the entry that works, the code will execute properly again for
the first row processed (which it previously did not), and then
subsequent rows again obtain the same error message. My question is,
does the MATCH function require some kind of reset? Or if anyone has
a suggestion to try something else? Thanks! Enzo
For n = 2 To llastRow
If (Trim(Sheets("Temp Output").Cells(n, 5).Value) <> "") Then
lend = False
a = 2
Do
test = Trim(Sheets("Temp Output").Cells(n, 5).Value)
lfoundRow = Application.Match(Trim(Sheets("Temp
Output").Cells(n, 5).Value), Sheets("Temp Output2").Range(Cells(a, 2),
Cells(1000, 2)), 0)
lactualRow = lfoundRow + a - 1
If (Trim(Sheets("Temp Output2").Cells(lactualRow + 3,
1).Value) = Trim(Sheets("Temp Output").Cells(n, 1).Value)) Then
lend = True
Sheets("Temp Output2").Select
Range("B" & lactualRow + cReportLength - 2).Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection,
Address:="", _
SubAddress:="'Cap by Site'!E" & n
Sheets("Temp Output").Select
Range("E" & n).Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection,
Address:="", _
SubAddress:="'Site Info'!A" & lactualRow
End If
a = lfoundRow + 1
Loop Until lend = True
End If
Next n
defined or object-defined error" when using the MATCH function. I
noticed that it occurs only in the second round of the loop. If I
delete the entry that works, the code will execute properly again for
the first row processed (which it previously did not), and then
subsequent rows again obtain the same error message. My question is,
does the MATCH function require some kind of reset? Or if anyone has
a suggestion to try something else? Thanks! Enzo
For n = 2 To llastRow
If (Trim(Sheets("Temp Output").Cells(n, 5).Value) <> "") Then
lend = False
a = 2
Do
test = Trim(Sheets("Temp Output").Cells(n, 5).Value)
lfoundRow = Application.Match(Trim(Sheets("Temp
Output").Cells(n, 5).Value), Sheets("Temp Output2").Range(Cells(a, 2),
Cells(1000, 2)), 0)
lactualRow = lfoundRow + a - 1
If (Trim(Sheets("Temp Output2").Cells(lactualRow + 3,
1).Value) = Trim(Sheets("Temp Output").Cells(n, 1).Value)) Then
lend = True
Sheets("Temp Output2").Select
Range("B" & lactualRow + cReportLength - 2).Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection,
Address:="", _
SubAddress:="'Cap by Site'!E" & n
Sheets("Temp Output").Select
Range("E" & n).Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection,
Address:="", _
SubAddress:="'Site Info'!A" & lactualRow
End If
a = lfoundRow + 1
Loop Until lend = True
End If
Next n