Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i round a number to the nearest 10?

Status
Not open for further replies.

thomasmcgeown

Technical User
Feb 6, 2002
27
GB
Im trying to set a vsb so that the value can only be a multiple of 10.

Is there a simple way to do this.

Thanks

Tom
 
Hi,

Put a button and a textbox on a form and try this:
-------------------------------------
Private Sub Command1_Click()
MsgBox (Round(Text1.Text / 10) * 10)
End Sub
-------------------------------------


Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
excellent thank you very much for the help, didnt completly solve the problem, but set meon the right track to do so.

im eternally grateful :p
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top