macro triggered by a change to a cell

  • Thread starter Thread starter Lee
  • Start date Start date
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.
 
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
 
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.
.
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top