Spin button problem

gwa1982

New Member
Joined
Aug 24, 2015
Messages
8
Hi,

I have an issue with a piece of code I am trying to attach to a spin button which will allow me to cycle through scenarios.

Sub Scenario_Change()


With sheets("General inputs")


With Selection
.Value = 0
.Min = 0
.Max = 3
.SmallChange = 1
.LinkedCell = "General inputs!$C$15"
.Display3DShading = True
End With
End With
End Sub

The VBA editor is saying that it doesn't accept the min value at zero and is delivering a runtime error 438. Can any one explain what I am doming wrong here?

The Macro is designed to use a spin button to hang values in a cell in a different work sheet called General inputs.

Many thanks for any help.

Regards
Geoff
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
"selection" is not a variable used with spinbuttons, nor is it the name of a control.
you seem to be setting properties of the control here rather than using it to branch your code?
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,552
Members
449,088
Latest member
davidcom

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