View Full Version : I need a macro to respond to a vlookup command
natanab
Jan 7, 2009, 08:38 PM
I understand the basics of Macros programming and have recorded a series of Macros within a workbook. What I want to happen is that when someone chooses an item in a drop down list, depending on which item they choose it will run one of the Macros. If they change their mind it will then run a new macro that will change other parts of the spreadsheet. I am using excel 2007.
bumble1290
Jan 7, 2009, 09:31 PM
I want to do exactly the same thing only I'm using excel 2003
JBeaucaire
Jan 7, 2009, 09:36 PM
Macros are fine, but you want to run macros from formulas? That's reinventing the wheel. If you want a macro to run to coincide with something in a cell, put some macro buttons on the screen and just let people "click" them. The first thing the macro does is set that cell to the value you want for that macro, then proceed through the rest of its task.
So if the box originally had 3 choices in a drop down, just put 3 buttons nearby instead.
JBeaucaire
Jan 7, 2009, 09:37 PM
BTW, tell me what you want happening off those choices, what do these macros do?
Perhaps macros are also overkill, sometimes formulas are still the best approach to some tasks.
mdosh01
Jan 8, 2009, 06:11 AM
Check this out. It will do exactly what you asked.
Run a Macro depending on the value selected from the drop-down list : Visual Basic for Applications (VBA) : Microsoft ISV Community Center : MSDN Forums (http://social.msdn.microsoft.com/forums/en-US/isvvba/thread/12226a43-1f04-4a0b-aa75-dc6b2b87ae15/)
Good luck.
bumble1290
Jan 8, 2009, 01:52 PM
Thanks for your replies, upon reflection and messing around with basic marcos yesterday, I think Vlookup might be a better option for what I'm trying to achieve.
TheCodeCageTeam
Jan 15, 2009, 05:37 PM
If you use a formula to reflect chabges across the worksheet remember that these are dependent on the structure of your worksheet remaining constant. Do use a macro if you want to change multiple cells for different values but have them static until the next time you run the code!
I understand the basics of Macros programming and have recorded a series of Macros within a workbook. What I want to happen is that when someone chooses an item in a drop down list, depending on which item they choose it will run one of the Macros. If they change their mind it will then run a new macro that will change other parts of the spreadsheet. I am using excel 2007.