Another spinner question

roscoe

Well-known Member
Joined
Jun 4, 2002
Messages
1,046
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
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

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
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)...
 
Upvote 0

Forum statistics

Threads
1,214,967
Messages
6,122,503
Members
449,090
Latest member
RandomExceller01

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
Back
Top