Forum Discussion
Sanders_Robert
Nov 09, 2022Copper Contributor
How to activate a macro by a word in a specific cell
1st time user of macro!
mtarler
Nov 09, 2022Silver Contributor
This doesn't make sense to me. Typically a macro will be activated by the user through the menus, or using a button or may run automatically. The automatic is based on an event like opening the workbook or making a change on the worksheet. One needs to be careful with the automatic type as it can really slow down a workbook performance.
So in answer to your question it can be done that if someone types a particular word in a specific cell a macro that runs on any change in the sheet could detect that and then execute a particular set of command and as part of those commands I assume you will erase that word (so it doesn't go in an infinite loop).
To do that you need to create an _onchange macro on the specific sheet it will be monitoring.
So in answer to your question it can be done that if someone types a particular word in a specific cell a macro that runs on any change in the sheet could detect that and then execute a particular set of command and as part of those commands I assume you will erase that word (so it doesn't go in an infinite loop).
To do that you need to create an _onchange macro on the specific sheet it will be monitoring.