vba - Start command multiple times in Excel using Macro -


i have command in custom tab in spreadsheet. want start command more 1 time different conditions in spreadsheet, i.e. cell changes every time want run command. results written in new sheets named after cell's value accordingly.

to run command macro put in quick access toolbar.

activecell.value = "2" application.sendkeys "%4" activecell.value = "3" application.sendkeys "%4" activecell.value = "4" application.sendkeys "%4" 

only last sendkeys command runs. wait delay , not make work.

any suggestions?

edit: typo

vba has built-in listeners events such cell changes. example:

private sub workbook_sheetchange(byval sh object, byval target range)  end sub 

you can use run macro each time change made. need disable listening while running or you'll create endless loop :)


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -