Hi,
I seem to be getting a "Method range of object _worksheet failed" error on my Sub but can't figure out why. It also seems to loop/calculate multiple times before returning the error.
I have researched and found out that it is when ranges are not qualified, but I can't seem to locate the issue with my code.
This is the part which fails:
Any help would be appreciated.
Thanks,
M
I seem to be getting a "Method range of object _worksheet failed" error on my Sub but can't figure out why. It also seems to loop/calculate multiple times before returning the error.
I have researched and found out that it is when ranges are not qualified, but I can't seem to locate the issue with my code.
Code:
Private Sub Worksheet_Calculate()
Dim aRng As Range, bRng As Range
Dim aCell As Range
Set aRng = ThisWorkbook.Worksheets("Lookups").Range("B3:B32")
Set bRng = ThisWorkbook.Worksheets("Lookups").Range("D3:D32")
For Each aCell In aRng
If aCell.Value <> " " Then
bRng.Value = aRng.Value
End If
Next
End Sub
This is the part which fails:
Code:
Set aRng = ThisWorkbook.Worksheets("Lookups").Range("B3:B32")
Any help would be appreciated.
Thanks,
M