Morning
I was wondering if when using Format ( expression, [ format ] ), could I use a variable in place of [ format ]?
On a userform I have a checkbox indicating 2 decimal places, default would be 1 decimal place.
Right now I have
altitude.Value = Format(2 * (y / b), "0.0")
blah blah blah
altitude.Value = Format(2 * (y / b), "0.00")
Anyway to make
Private Sub dec2_Click()
Dim decplace As String
If dec2.Value = True Then
decplace = "0.00"
Else
decplace = "0.0"
End If
End Sub
altitude.Value = Format(2 * (y / b), decplace)
I hope I was clear in my request.
Would appreciate any help with this problem.
Thanks in advance.
BTW, am using Excel 2007.
George
Bookmarks