Method range of object _worksheet failed

M1111

New Member
Joined
Feb 3, 2017
Messages
6
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.


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
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
My worksheet also gets stuck in a calculation loop for 5/10 seconds too. I'm not sure if it's related.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top