How do i start Macros using IF statements?

X

xXx Katie xXx

How can i use an IF statement to start a macro using data validation to get a
list in a cell if the previous cell equals a specific word.

Eg. IF C1 = "Bedroom" then it will trigger the macro to use data validation
in the next cell to display a list of diffent number of bedrooms which the
user can then choose.
 
G

Guest

xXx said:
How can i use an IF statement to start a macro using data validation to get a
list in a cell if the previous cell equals a specific word.

Eg. IF C1 = "Bedroom" then it will trigger the macro to use data validation
in the next cell to display a list of diffent number of bedrooms which the
user can then choose.


I'm not aware of a way to directly do what you want -- perhaps some else here
will. However....

You can call functions from normal Excel formulas. e.g.:

If(C1="Bedroom",YourCustomFunction(A1:B2),"no activity")

Perhaps you can use a VBA custom function to do what you want? The primary
difference is that a macro can reach out and touch anything anywhere. A
function can only touch cells which are included in its parameter list when you
call it.

Good luck...

Bill
 
Top