View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Michael Malinsky[_2_] Michael Malinsky[_2_] is offline
external usenet poster
 
Posts: 32
Default Format textbox on exit

I have the following:

Private Sub tbAnnualInterest_Exit(ByVal Cancel As
msforms.ReturnBoolean)

tbAnnualInterest = Format(tbAnnualInterest / 100, "0.0000%")

End Sub


which works fine the first time a value (a percentage entered as 4.9
vs. .049) is entered into the textbox. However, if the textbox is
entered and exited without entering a new value, I get a Type mismatch
error. I've tried using various combinations of Val and/or CStr and
anything else I thought might be useful.

Any suggestions, as always, are greatly appreciated.

TIA
Mike