Sub Macro1()
Dim Cel As Range
Dim Rng As Range
Dim Local_Variable As Object
Set Rng = Worksheets("Index").Range("B5:B142")
For Each Cel In Rng
If Cel.Offset(0, 4) <> "X" And Cel.Offset(0, 8).Value = "X" Then
Cel.Offset(0, -1).Hyperlinks(1).Follow
If Application.WorksheetFunction.CountIf(Worksheets("Sheet1").Range("A1:A68"), Range("B4").Value) = 1 Then
Set Local_Variable = Worksheets("Table 1").Range("AL67:AL2255").Find(Range("B4").Value)
Range("G25") = Local_Variable.Offset(6, -37).Value
Range("G26") = Local_Variable.Offset(7, -37).Value
Range("G27") = Local_Variable.Offset(8, -37).Value
Range("G28") = Local_Variable.Offset(9, -37).Value
Range("G29") = Local_Variable.Offset(10, -37).Value
Range("G30") = Local_Variable.Offset(11, -37).Value
I have had this issue many times, and worked around it rather than figure it out. Local_Variable causes a runtime error 91. Can anyone help me here?
Dim Cel As Range
Dim Rng As Range
Dim Local_Variable As Object
Set Rng = Worksheets("Index").Range("B5:B142")
For Each Cel In Rng
If Cel.Offset(0, 4) <> "X" And Cel.Offset(0, 8).Value = "X" Then
Cel.Offset(0, -1).Hyperlinks(1).Follow
If Application.WorksheetFunction.CountIf(Worksheets("Sheet1").Range("A1:A68"), Range("B4").Value) = 1 Then
Set Local_Variable = Worksheets("Table 1").Range("AL67:AL2255").Find(Range("B4").Value)
Range("G25") = Local_Variable.Offset(6, -37).Value
Range("G26") = Local_Variable.Offset(7, -37).Value
Range("G27") = Local_Variable.Offset(8, -37).Value
Range("G28") = Local_Variable.Offset(9, -37).Value
Range("G29") = Local_Variable.Offset(10, -37).Value
Range("G30") = Local_Variable.Offset(11, -37).Value
I have had this issue many times, and worked around it rather than figure it out. Local_Variable causes a runtime error 91. Can anyone help me here?