Percenatge Format in TextBox

G

Guest

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;
haven’t found the answer yet. Any help would be greatly appreciated!

Regards,
Ryan---
 
R

Rick Rothstein \(MVP - VB\)

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

Try it this way...

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

Rick
 
R

Rick Rothstein \(MVP - VB\)

Sorry Vergel,

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

Rick
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top