Can a ‘Click’ event be included within code to trigger a macro on another worksheet (WS)?
I have a workbook which monitors share prices, and through a macro changes the value in columns H & I on worksheet (WS) 1 and cols E & F on WS2 should the value in cols G & D respectively be higher or lower than the values already there. (The macros on both sheets are similar but use different columns).
On WS1 the macro is activated by ‘clicking’ on a Command Button, (the GREEN one on the attached file) which does other things before changing any values. No problem here.
The values are imported from the web into WS3 and 4 (Import Share Price and Import Tracking) which are linked to cols G and D on WS1 and 2 respectively.
On WS2 I have to physically go to that sheet and ‘Click’ on any cell to activate the macro, as the macro on both sheets starts as:
What I want to do is reduce the two actions into one so the macro on WS2 automatically runs after the actions on WS1 once the Command Button is pressed.
I assume that the two macros cannot be combined, as WS2 would not be the active worksheet, so can WS2 be selected and the macro run with a ‘Click’ event on that sheet, or is there another way around this.
I attach a sanitized file with all the code on both WS’s.
To test any solution, enter a value greater and lesser than those shown in cells G51 and G52 on WS4 (Import Tracking). These values will then be shown in cells D53 and 54 on WS2, and should increase and decrease the values in cells E53 and F54 after the macro is run.
Bookmarks