Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-07-2015, 09:27 AM
KangarooJack KangarooJack is offline How to increase Spin Button by .1 decimal Windows 7 64bit How to increase Spin Button by .1 decimal Office 2007
Novice
How to increase Spin Button by .1 decimal
 
Join Date: Dec 2015
Posts: 5
KangarooJack is on a distinguished road
Default How to increase Spin Button by .1 decimal

I have a Spin button (SpinButton1) connected to a text box (txtVersion) and I need it to increase by .1 so Version Numbers are 2.0, 2.1,2.2, etc...



When I try to change the Value in Properties to 2.0 or SmallChange to .1 I get an error message.

Also, if that doesn't work, is there a way to set the default value in txtVersion to "2.0" ?
Reply With Quote
  #2  
Old 12-07-2015, 04:50 PM
macropod's Avatar
macropod macropod is offline How to increase Spin Button by .1 decimal Windows 7 64bit How to increase Spin Button by .1 decimal Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Without actually seeing the problem userform and the code behind it, it can be difficult for anyone to diagnose the issue. Can you attach a document to a post with just the userform? You do this via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 12-07-2015, 07:06 PM
gmaxey gmaxey is offline How to increase Spin Button by .1 decimal Windows 7 32bit How to increase Spin Button by .1 decimal Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

You will need to define the textbox value as a double:

Code:
Private Sub SpinButton1_SpinDown()
Dim dblRev As Double
  dblRev = CDbl(TextBox1.Text) - 0.1
  TextBox1.Text = Format(dblRev, "0.0")
End Sub
Private Sub SpinButton1_SpinUp()
Dim dblRev As Double
  dblRev = CDbl(TextBox1.Text) + 0.1
  TextBox1.Text = Format(dblRev, "0.0")
End Sub
Private Sub UserForm_Initialize()
 TextBox1.Text = Format(CDbl("1.0"), "0.0")
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #4  
Old 12-08-2015, 05:50 AM
KangarooJack KangarooJack is offline How to increase Spin Button by .1 decimal Windows 7 64bit How to increase Spin Button by .1 decimal Office 2007
Novice
How to increase Spin Button by .1 decimal
 
Join Date: Dec 2015
Posts: 5
KangarooJack is on a distinguished road
Default

Thank you gmaxey that worked perfect!
Reply With Quote
Reply

Tags
form field, spinbutton, vba code



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to increase Spin Button by .1 decimal Help with Spin button and Do Loop combination Formd Word VBA 11 11-12-2015 02:33 PM
How to increase Spin Button by .1 decimal Multiple spin animations one after the other maximus123 PowerPoint 1 08-04-2015 05:33 AM
Pulling 2 digits before a decimal point from adjoining cell then zeros after decimal jadess916 Excel 1 06-26-2014 03:48 AM
How to copy format of a column using spin button Tyberian1988 Excel Programming 2 03-10-2014 10:09 PM
How to increase Spin Button by .1 decimal How to remove Spin button hannu Excel 3 11-14-2013 01:42 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:34 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft