Excel VBA UserForm TextBox - How to format number

Published: 06 January 2015
on channel: InAnOffice
83k
326

Excel VBA UserForm TextBox - Learn how to format number

The code used in this video:

Private Sub UserForm_Initialize()

Dim Price As Double
Price = 9

Dim Discount As Double
Discount = 0.25

Dim InStock As Integer
InStock = 1

'General Number-displays a number without thousand separators
txtPrice = Format(Price, "General Number")

'Standard - displays the thousand separators,
'at least one digit to the left of the decimal place,
'and two digits to the right of the decimal place
'txtPrice = Format(Price, "Standard")

'Fixed - displays at least one digit to the left of the decimal place
'and two digits to the right of the decimal place.
'txtPrice = Format(Price, "Fixed")

'txtPrice = Format(Price, "0.00")
'txtPrice = Format(Price, "

'Currency - displays thousand separators
'two decimal places
'txtPrice = Format(Price, "Currency")
'txtPrice = Format(Price, "$

'txtDiscount = Format(Discount, "Percent")
'txtDiscount = Format(Discount, "0.00%")

'txtInStock = Format(InStock, "Yes/No")
'txtInStock = Format(InStock, "True/False")
'txtInStock = Format(InStock, "On/Off")

End Sub


Watch video Excel VBA UserForm TextBox - How to format number online without registration, duration 05 minute 55 second in high hd quality. This video was added by user InAnOffice 06 January 2015, don't forget to share it with your friends and acquaintances, it has been viewed on our site 83 thousand once and liked it 326 people.