Runtime error 1004 - method 'Range' of object '_Worksheet' failed

stevieinselby

New Member
Joined
Nov 12, 2015
Messages
27
Runtime error 1004 - method 'Range' of object '_Worksheet' failed
This seems to be a very common error message, but none of the other problems that people have been having with it seem to have the same cause as mine...

In the code for one of my worksheets I have:
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Target(1, 1).Address = "$Y$13" Then
    Cancel = True
    UserForm.Show
    End If
End Sub

When I double-click on Y13 in that worksheet, instead of bringing up the user form like it did a couple of weeks ago when I set it up, it now brings up the dreaded 1004, and when I debug, it highlights "UserForm.Show".

UserForm is all set up under Forms, and I can't figure out why it isn't running, especially as the bit it has highlighted refers to neither Range nor Worksheet. Any suggestions?
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Sounds like the problem is in the userform code, probably in the Initialize or Activate event.

Goto Tools>Options... and check Break in class modules in the Error trapping level section on the General tab.

Now the next time you get the error Debug should lead you to the real culprit.
 
Upvote 0
Brilliant, thank you Norie ... that has led me straight to the named range that had a load of errors in it after I had deleted and moved stuff elsewhere. All fixed and fine now :)
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,427
Members
448,961
Latest member
nzskater

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