Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
xXx Katie xXx
 
Posts: n/a
Default 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.
  #2   Report Post  
Gary's Student
 
Posts: n/a
Default

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.

  #3   Report Post  
Bill Martin -- (Remove NOSPAM from address)
 
Posts: n/a
Default

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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving Macros Gerald Excel Discussion (Misc queries) 1 August 19th 05 02:28 PM
Transferring toolbars and macros to other computers Darrell Excel Discussion (Misc queries) 1 January 19th 05 01:21 AM
The available macros list in XL; how to suppress filename from showing KR Excel Discussion (Misc queries) 1 January 10th 05 08:20 PM
UUsing the NetworkDays Function with IF Statements carl Excel Worksheet Functions 1 December 30th 04 10:12 PM
Inserting Blank Rows Macro? Michael Saffer Excel Worksheet Functions 2 November 9th 04 07:23 PM


All times are GMT +1. The time now is 01:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"