Another spinner question

roscoe

Well-known Member
Joined
Jun 4, 2002
Messages
1,026
I have one cell, B4, that tells me how many "somethings" I can have. Cell B6 is where the user picks which "something" to use, min=1 and max=the value of B4.

How can I build a spin button where the user can just cycle from 1,2,3,...max where the max is not fixed?

Thanks!

Roscoe
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

roscoe

Well-known Member
Joined
Jun 4, 2002
Messages
1,026
OK, I constructed the following code by plagiarizing from some similar code I found elsewhere, but it's giving me a bizarre error message (and I'm not even sure if this should work):
Code:
Private Sub SpinButton6_Change()
Dim Slice_to_edit As Range

Set Slice_to_edit = Worksheets("Data").Range("Slice_to_edit")
    If SpinButton6 > 0 And SpinButton6 < 5 Then
        Slice_to_edit.value = SpinButton6
    End If
End Sub

The named range "Slice_to_edit" is the value in cell B6 I want to roll with the spinner. But when I click on the spin button I get "compile error: procedure declaration does not match description of event or procedure having the same name"

Note I hard coded the maximum value 5 for testing but it really needs to reference the value in cell B4. NOt worried about that yet, just wnat to see if this can work

No clue what this means (No, I don't have another procedure with the same name)...
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,678
Messages
5,833,079
Members
430,190
Latest member
beaviss

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top