Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default formatting combobox

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set up conditional formatting in Combobox list? DaveHarding Excel Discussion (Misc queries) 4 January 28th 09 04:10 PM
formatting the list items for ComboBox created using Forms Desmond Excel Discussion (Misc queries) 3 May 4th 06 10:04 AM
How Do I Load A ComboBox RowSource From The Results Of Another ComboBox Minitman[_4_] Excel Programming 3 October 26th 04 07:58 PM
cell formatting based on combobox Bob Phillips[_6_] Excel Programming 0 May 10th 04 08:17 PM
Formatting a ComboBox selection Ray Kanner[_2_] Excel Programming 9 January 2nd 04 06:12 PM


All times are GMT +1. The time now is 06:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"