ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Scroll Bar / Spin Button Small Change value (https://www.excelbanter.com/excel-programming/374270-scroll-bar-spin-button-small-change-value.html)

PCH

Scroll Bar / Spin Button Small Change value
 
I'm using the following code for a scroll bar, straight from the help menu.
I need the small change value to be "0.5".
In this instance it does not work.
Any ideas why?
regards
Wayne


Private Sub Workbook_Open()
Set sb = Worksheets(1).Shapes.AddFormControl(xlScrollBar, _
Left:=10, Top:=10, Width:=10, Height:=200)
With sb.ControlFormat
.LinkedCell = "D1"
.Max = 100
.Min = 0
.LargeChange = 10
.SmallChange = 0.5

End With


End Sub

NickHK

Scroll Bar / Spin Button Small Change value
 
If you check the Object Browser, you can see these properties of are longs,
hence no decimal part.
If you need this, multiply all properies by 10, then divide by 10 before
using the .Value.

NickHK

"PCH" wrote in message
...
I'm using the following code for a scroll bar, straight from the help

menu.
I need the small change value to be "0.5".
In this instance it does not work.
Any ideas why?
regards
Wayne


Private Sub Workbook_Open()
Set sb = Worksheets(1).Shapes.AddFormControl(xlScrollBar, _
Left:=10, Top:=10, Width:=10, Height:=200)
With sb.ControlFormat
.LinkedCell = "D1"
.Max = 100
.Min = 0
.LargeChange = 10
.SmallChange = 0.5

End With


End Sub





All times are GMT +1. The time now is 09:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com