Worksheet_Change Event, monitoring more than one cell

BenRichards

New Member
Joined
Apr 7, 2014
Messages
41
Hi,

I get the error "Object required," and debug highlights the bolded line. What is wrong with this bit of code?

Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect(Target, Range("T82:AA457")) Is Nothing And ActiveSheet.Range("V80").Value = "-" Then
Application.EnableEvents = False
ActiveSheet.Range("T82:AA457").Value = ""
Application.EnableEvents = True
End If

Thanks for your help!

End Sub
 
Last edited:

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Maybe it's the 'Thanks for your help!' before the End Sub. ;)
 
Upvote 0
VoG, encouraged by your comment I moved that bit of code from within a called macro to directly underneath the:

Private Sub Worksheet_Change(ByVal Target As Range)

And it works just fine. But if I put in Call Macro1 and insert the code into such a Macro, object required. Weird, but I think I can get along with this. Thanks.

RoryA, :LOL:
 
Upvote 0
Did you pass Target to the macro? If not, you would get that error.
 
Upvote 0

Forum statistics

Threads
1,214,927
Messages
6,122,311
Members
449,080
Latest member
jmsotelo

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