Initiate Macro via change in drop Down List

S

Sean

How can I initiate a Macro when I change a selection from a DV
Dropdown list?

I have a DV Drop down that selects a week, I then have to run a macro
that clears data. Could I in effect join the two together, if so how?


Thanks
 
G

Guest

We can use an event macro:

Private Sub Worksheet_Change(ByVal Target As Range)
Set r = Range("A1")
If Intersect(Target, r) Is Nothing Then Exit Sub
Application.EnableEvents = False
Range("B1").Clear
Application.EnableEvents = True
End Sub

If you change A1 (whether by DV or typing) B1 is cleared.

This goes in the worksheet code area, not a standard module
 
S

Sean

Thanks Gary, is it possible to call a macro from within, in the
Workseet code (thats already within a standard module)?
 
S

Sean

Just did it, simple just quote the macro. Always confused if you can
or cannot call a macro from outside a standard module
 

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

Top