![]() |
How do i start Macros using IF statements?
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. |
You need a worksheet change event macro to monitor C1 and respond accordingly.
See: http://www.mvps.org/dmcritchie/excel/event.htm for complete details. Good Luck -- Gary's Student "xXx Katie xXx" wrote: 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. |
xXx Katie xXx wrote:
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 |
All times are GMT +1. The time now is 04:52 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com