How to run Macro on entry to new sheet?
Good day all,
I have been struggling to make a macro work latley and wanted to know if any of you could help...
The macro is named macro1, its short key is q....
At the end of the macro it goes to the next sheet (by sendkeys "^PGDN")
So, using sendkeys i have writen the following to have the macro run 10 times:
Application.SendKeys Keys:="^q", Wait:=True
Application.SendKeys Keys:="^q", Wait:=True
Application.SendKeys Keys:="^q", Wait:=True
Application.SendKeys Keys:="^q", Wait:=True
Application.SendKeys Keys:="^q", Wait:=True
Application.SendKeys Keys:="^q", Wait:=True
Application.SendKeys Keys:="^q", Wait:=True
Application.SendKeys Keys:="^q", Wait:=True
Application.SendKeys Keys:="^q", Wait:=True
Application.SendKeys Keys:="^q", Wait:=True
......but it runs fine the first time and then when it goes to the next sheet it just stops, no error msg or nothing. Just sits there like as if it did what i wanted it to.
Does anyone know of somekind of delay mechanism or method that can get this to work?
(Im running out of hair here pulling it out!!)
|