Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default format cell reference in a text box


How do I format the resulting number that is displayed in a text box? I
have used the linked cell property to define that cell C17 is what appears in
the text box. Cell C17 is a percentage. Currently it will display as
3.3333333333333E-2 for 3.33%. I would like it to appear in the text box as
3.33%. How do I limit the decimal places and add the % sign?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default format cell reference in a text box

Use the change event to reformat the textbox:

Private Sub Textbox1_Change()
Textbox1.Value = Format(Textbox1.Value,"0.00%")
End Sub


--
Regards,
Tom Ogilvy

"Tbone" wrote:


How do I format the resulting number that is displayed in a text box? I
have used the linked cell property to define that cell C17 is what appears in
the text box. Cell C17 is a percentage. Currently it will display as
3.3333333333333E-2 for 3.33%. I would like it to appear in the text box as
3.33%. How do I limit the decimal places and add the % sign?

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default format cell reference in a text box

Thanks that did it!

"Tom Ogilvy" wrote:

Use the change event to reformat the textbox:

Private Sub Textbox1_Change()
Textbox1.Value = Format(Textbox1.Value,"0.00%")
End Sub


--
Regards,
Tom Ogilvy

"Tbone" wrote:


How do I format the resulting number that is displayed in a text box? I
have used the linked cell property to define that cell C17 is what appears in
the text box. Cell C17 is a percentage. Currently it will display as
3.3333333333333E-2 for 3.33%. I would like it to appear in the text box as
3.33%. How do I limit the decimal places and add the % sign?

Thanks

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
Conditional format when text contains using cell reference Cheryl Excel Worksheet Functions 4 July 31st 08 04:14 PM
Combining text and cell reference keeping number format RajenRajput1 Excel Discussion (Misc queries) 6 August 23rd 07 05:18 PM
Can cell format come from and change with reference cell format jclouse Excel Discussion (Misc queries) 1 November 29th 06 03:20 AM
format a cell with a formula so an empty reference cell shows blan M2 Excel Discussion (Misc queries) 3 November 7th 06 10:42 PM
Making cell reference absolute makes cell format text Excel Worksheet Functions 2 September 22nd 06 04:47 PM


All times are GMT +1. The time now is 07:42 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"