Thread: Input Box Q
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Seanie Seanie is offline
external usenet poster
 
Posts: 202
Default Input Box Q

Thanks Roger, I've tried to format the output cell as 0.00%, but it
only shows as 0.00, why is that?

uservalue = InputBox("Value to use? Between 0% and 99%")
uservalue2 = Format(uservalue, "#.00")
If uservalue2 < 0 Or uservalue2 99 Then
MsgBox "Value outside range of 0% to 99%"
Exit Sub
End If
If uservalue2 1 Then
uservalue = Format(uservalue2 / 100, "#%")
Else
uservalue = Format(uservalue2, "#.00%")
End If
Range("B3").Value = uservalue
Selection.NumberFormat = "0.00%"