Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default How to get desired format in textbox linked to a cell

I have a textbox linked to a cell via its controlsource property. The
cell's format is numeric with two decimals. If the value in the cell is 7,
the cell shows "7.00" but the text box shows "7"

How can I make the textbox show "7.00"?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How to get desired format in textbox linked to a cell

Format it

TextBox1.Text = Format(TextBox1.Text,"0.00")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

wrote in message
...
I have a textbox linked to a cell via its controlsource property. The
cell's format is numeric with two decimals. If the value in the cell is

7,
the cell shows "7.00" but the text box shows "7"

How can I make the textbox show "7.00"?

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default How to get desired format in textbox linked to a cell

Thnks for the reply. I tried doing that just after after the textbox's
controlsource was set and immediately before the form was shown and it does
not work.

If the user changes the content of the textbox, I can format it in a
TextBox_Exit routine and it works fine, but that still leaves the initial
display incorrect.

On Wed, 14 Jan 2004 10:43:10 -0000, "Bob Phillips"
wrote:

Format it

TextBox1.Text = Format(TextBox1.Text,"0.00")


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How to get desired format in textbox linked to a cell

Try it in the Userform_Activate() event.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

wrote in message
...
Thnks for the reply. I tried doing that just after after the textbox's
controlsource was set and immediately before the form was shown and it

does
not work.

If the user changes the content of the textbox, I can format it in a
TextBox_Exit routine and it works fine, but that still leaves the initial
display incorrect.

On Wed, 14 Jan 2004 10:43:10 -0000, "Bob Phillips"
wrote:

Format it

TextBox1.Text = Format(TextBox1.Text,"0.00")




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
TextBox linked to cell????? hoyos Excel Discussion (Misc queries) 4 January 21st 10 10:12 PM
Cell that is linked to a Textbox, loses formula? Pilot Excel Discussion (Misc queries) 0 April 3rd 08 02:31 PM
Textbox linked to a cell (reposted) Pilot Excel Discussion (Misc queries) 0 April 1st 08 10:03 AM
Textbox linked to a cell (reposted) Pilot Excel Discussion (Misc queries) 0 March 30th 08 10:45 AM
Textbox linked to a cell Pilot Excel Discussion (Misc queries) 2 March 29th 08 10:29 AM


All times are GMT +1. The time now is 04:14 PM.

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

About Us

"It's about Microsoft Excel"