macro triggered by a change to a cell

L

Lee

I want a macro ("WWW") to run wheneven I change the
selection in a combobox (located in sheet "XX"
Cell "Q2")? How do I write "WWW"? thanks much.
 
J

Juan Sanchez

In XX sheet's view code...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Set rng = [Q2]

If Intersect(Target, rng) Is Nothing Then Exit Sub

'write your code here

End Sub

Cheers
Juan
 
L

lee

Thanks, but it didn't seem to run? Should I
define "Target"? and Should I output the selection made by
the combbox to cell "Q2"? thanks.
-----Original Message-----

In XX sheet's view code...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Set rng = [Q2]

If Intersect(Target, rng) Is Nothing Then Exit Sub

'write your code here

End Sub

Cheers
Juan





-----Original Message-----
I want a macro ("WWW") to run wheneven I change the
selection in a combobox (located in sheet "XX"
Cell "Q2")? How do I write "WWW"? thanks much.
.
.
 
Top