Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Percenatge Format in TextBox

I am using a few simple lines of code in a TextBox such as:

TextBox6.Value = Cells(290, 3)

This takes a value from a cell, and displays it on my UserForm. The only
problem is that it is always displayed in the TextBox in a format such as .2,
or .493, or some such thing. I am trying to get the TextBox to display the
value in percentage format, perhaps even with two decimal places. How can I
do this? I tried the Macro Recorder, and I looked on several web sites;
havent found the answer yet. Any help would be greatly appreciated!

Regards,
Ryan---


--
RyGuy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Percenatge Format in TextBox

Ryan,

Try something like this:

TextBox6.Value = Format(Cells(290, 3), "##0.00%")

--
Hope that helps.

Vergel Adriano


"ryguy7272" wrote:

I am using a few simple lines of code in a TextBox such as:

TextBox6.Value = Cells(290, 3)

This takes a value from a cell, and displays it on my UserForm. The only
problem is that it is always displayed in the TextBox in a format such as .2,
or .493, or some such thing. I am trying to get the TextBox to display the
value in percentage format, perhaps even with two decimal places. How can I
do this? I tried the Macro Recorder, and I looked on several web sites;
havent found the answer yet. Any help would be greatly appreciated!

Regards,
Ryan---


--
RyGuy

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Percenatge Format in TextBox

TextBox6.Value = Format(Cells(290, 3), "##0.00%")

Try it this way...

TextBox6.Text = Format$(Cells(290, 3), "0.00%")

Rick
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Percenatge Format in TextBox

Sorry Vergel,

My post was not directed at you... I meant to post it to the OP.

Rick


TextBox6.Value = Format(Cells(290, 3), "##0.00%")


Try it this way...

TextBox6.Text = Format$(Cells(290, 3), "0.00%")

Rick

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Percenatge Format in TextBox

What I have read is that there is no advantage to using the $ versions of the
function in current versions of VBA. (implications are that they executed the
same).

? typename(Format$(.23, "0.00%"))
String
? typename(Format(.23, "0.00%"))
String

--
Regards,
Tom Ogilvy


"Rick Rothstein (MVP - VB)" wrote:

TextBox6.Value = Format(Cells(290, 3), "##0.00%")


Try it this way...

TextBox6.Text = Format$(Cells(290, 3), "0.00%")

Rick



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Percenatge Format in TextBox

Excellent! That's exactly what I was looking for.
Thanks so much!!
--
RyGuy


"Vergel Adriano" wrote:

Ryan,

Try something like this:

TextBox6.Value = Format(Cells(290, 3), "##0.00%")

--
Hope that helps.

Vergel Adriano


"ryguy7272" wrote:

I am using a few simple lines of code in a TextBox such as:

TextBox6.Value = Cells(290, 3)

This takes a value from a cell, and displays it on my UserForm. The only
problem is that it is always displayed in the TextBox in a format such as .2,
or .493, or some such thing. I am trying to get the TextBox to display the
value in percentage format, perhaps even with two decimal places. How can I
do this? I tried the Macro Recorder, and I looked on several web sites;
havent found the answer yet. Any help would be greatly appreciated!

Regards,
Ryan---


--
RyGuy

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 format? Pas Excel Discussion (Misc queries) 5 April 25th 10 11:13 PM
Calculating a percenatge based on dates Oldmanoutofhisdepth Excel Worksheet Functions 1 November 5th 09 02:46 PM
percenatge increase in values across multiple cells David New Users to Excel 2 June 23rd 06 12:06 AM
textbox format [email protected] Excel Programming 2 May 18th 06 02:10 AM
TextBox Format grahammal Excel Discussion (Misc queries) 3 March 29th 06 01:35 PM


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