Horje
vba round number Code Example
vba round number
Function RoundTo(pNumber As Long, pFactor As Long)
    RoundTo = Round(pNumber / pFactor) * pFactor 
End Function
' ---------------------------------------------------------------
Sub TestMe()
    Debug.Print RoundTo(2543, 10)    			' => 2540
    Debug.Print RoundTo(2546, 10)    			' => 2550
    Debug.Print Application.RoundUp(10.1, 0) 	' => 10
    Debug.Print Application.RoundUp(10.6, 0) 	' => 11
    Debug.Print Application.RoundDown(10.6, 0) 	' => 10
End Sub




Vb

Related
vba reverse string Code Example vba reverse string Code Example
excel vba to lower case Code Example excel vba to lower case Code Example
if inputbox cancel vba Code Example if inputbox cancel vba Code Example
vba remove first 2 characters from string Code Example vba remove first 2 characters from string Code Example
perform http request in vb.net Code Example perform http request in vb.net Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8