Excel: Change Event based on Defined Name

gapa

New Member
Joined
Jul 3, 2007
Messages
10
Dear All,

Is there a way in Excel to trigger an event change based on "Defined name" ?

I.e if I define cell A1 as "Test", how do I change the code so that it will trigger ?

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Test Then << Doesn't work
Call Page1.Booking_Type
End If
End Sub

Thanks
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hi gapa -

You need to use 'not intersect' if you have a range (even if the range is only 1 cell, once it has a name it's a range)...

Try:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("Test ")) Is Nothing Then
Call Page1.Booking_Type
End If
End Sub
 
Upvote 0
Or,

you could also try

Code:
If Target.Name = "Test" Then
<input id="gwProxy" type="hidden"><!--Session data--><input *******="jsCall();" id="jsProxy" type="hidden">
 
Upvote 0

Forum statistics

Threads
1,214,810
Messages
6,121,690
Members
449,048
Latest member
81jamesacct

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