View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default formatting combobox

sStr = Textbox1.Text
sStr = replace(sStr,"$","")
if isnumeric(sStr) then
sStr = format(cdbl(sStr),"0.00")
Combobox1.AddItem sStr
End if
--
Regards,
Tom Ogilvy

"JT" wrote in message
...
In a form users, enter an amount in a text box. They can
enter 2.00, 2.0 or 2 for $2.00. This data is then moved
to a combobox.

However the user enters the data is how it appears in the
combobox.

Is there a way to either (1) format the amount as 2.00
automatically, no matter how they enter it, or (2) force
the user to enter the data correctly before they can leave
the text box (private sub?)?

Thanks for the help....Mike