• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Linking spin button properties to cells

Right click the spin button > Format Control.

Is it possible to link the Current value and Incremental Change fields to a cell in the spreadsheet?

If not, can this be done with VBA? If so, can you recommend any websites?
 

Attachments

  • Spin Button.xlsx
    24.4 KB · Views: 3
Is it possible to link the Current value and Incremental Change fields to a cell in the spreadsheet?
1. The spinner in your sheet's current value is already bi-directionally linked to cell L9; click the spinner and L9 will change, change L9 and the spinner's value will change.
2. Changing the incremental value, no, it can't be linked directly like point 1 above, however, one line of vba can do this: if you wanted the incremental change to be the same as in cell G5 then the likes of:
Code:
ActiveSheet.Spinners("Spinner 1").SmallChange = Range("G5").Value
will do it.

If you wanted to change which cell is linked to the spinner, then like:
Code:
ActiveSheet.Spinners("Spinner 1").LinkedCell = Range("I5").Address
or:
Code:
ActiveSheet.Spinners("Spinner 1").LinkedCell = "M9"
but note that that cell will change to take on the value of the spinner.
If you wanted the spinner to take on the cell's new value too, then you'd have to:
Code:
With ActiveSheet.Spinners("Spinner 1")
  .Value = Range("H5").Value
  .LinkedCell = "H5"
End With
 
Last edited:
I had to rearrange things a little bit to be more clear.

1. Start from a blank cell in N5
2. In cell N5, the user would select a strike price from the data validation drop-down menu
3. Then the user can click the spinner button in cell M5 to adjust the strike price up or down. As they adjust the strike price, the value in N5 would change accordingly.
4. When the user modifies the strike price, it should occur in increments defined in P5. This will ensure that the strike prices that they select are the ones in the data validation list in cell N5.

If this will require writing VBA code, I'm open to that.
 

Attachments

  • Spin Button Adjust Strike Price.xlsx
    24.2 KB · Views: 2
See attached. Allow macros.
Spinner increments remain 1 at all times. No linked cell
Some code in the sheet concerned's code-module.
 

Attachments

  • Chandoo56173Spin Button Adjust Strike Price.xlsm
    31.8 KB · Views: 0
Back
Top