In the attached file you will see the explanation and wanted.
Shortly, I need the code, which will run based on Spin Button Linked variable cell value.
Waiting for help, thanks in advance for any reply.
Regards.
In the attached file you will see the explanation and wanted.
Shortly, I need the code, which will run based on Spin Button Linked variable cell value.
Waiting for help, thanks in advance for any reply.
Regards.
I have a possible solution using Worksheet_Calculate() instead of Worksheet_Change(). The attached workbook was written and tested in Excel 2003, but should work in your version of Excel.
To implement my solution:
a. Add a cell in your sheet that references cell A1 for a calculation.
I have cell 'A5' contain the formula '=A1'. This cell can probably be hidden.
b. In a user module declare a global variable that contains the 'A1' value.
The User Code can be in this module or in any User Module.
c. In the 'Sheet1' module put the Worksheet_Calculate(). This will fire your![]()
Please Login or Register to view this content.
user defined Macros 1 thru 7.
![]()
Please Login or Register to view this content.
Rather than messing with event code, you could assign a Macro like this (in a normal module) to the spin button.
You might want to put some code in to prevent routineOne from running again if spinner value is 1 and the down button is pressed.![]()
Please Login or Register to view this content.
_
...How to Cross-post politely...
..Wrap code by selecting the code and clicking the # or read this. Thank you.
Thanks LJMetzger,
Dear mikerickson, thanks for solution with so short code.
But, I'd be very pleased if there is any code to prevent when SpinButton value 1 pressed down and SpinButton value 7 pressed up.
Something like this will work.
A spin button calling routines is most unusual. It cannot be used to call routineThree and then routineFive directly. Nor is it a intuative userinterface. You might consider two command buttons, a Run Next Routine and a Run Previous Routine button, their captions could be controlled so which routine is Next and Previous could be obvious to the user.![]()
Please Login or Register to view this content.
If you create ButtonNext and ButtonPrevious and assign DoRoutine to both of them, it will do as the attached file.
![]()
Please Login or Register to view this content.
Last edited by mikerickson; 10-20-2013 at 11:25 AM.
Thanks al lot mikerickson,
Both are working.
I am very grateful.
Regards
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks