Format TextBox on UserForm

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Thanks to several people who use this DG, I just recently learned how to
format data coming from a SS to a UserForm. I am wondering if there is a way
to format data on the UserForm, to make it easier for the user to quickly and
easily distinguish between, let’s say 1000000 and 10000000. I tried the
following:

Format(Cells(27, 2), "$#,##0.00") = TextBox4.Text


That didn’t really seem to do anything at all. Does anyone have any
suggestions as to how to do this?

Cordially,
Ryan---
 
Thanks to several people who use this DG, I just recently learned how to
format data coming from a SS to a UserForm. I am wondering if there is a way
to format data on the UserForm, to make it easier for the user to quickly and
easily distinguish between, let's say 1000000 and 10000000. I tried the
following:

Format(Cells(27, 2), "$#,##0.00") = TextBox4.Text

That didn't really seem to do anything at all. Does anyone have any
suggestions as to how to do this?

Cordially,
Ryan---

Isn't your version backwards?


TextBox4.Text=Format(Cells(27, 2), "$#,##0.00")

would seem more likely
 
Sorry for not explaining the issue better. The problem is that I am taking
input from the UserForm and transferring it to the SS. I want to try to
format the value as currency when the user is entering data in to UF. I
already have the formatting that I need when the data goes from the SS to the
UF.

Any ideas?
 
another way is to transfer the number and then format the cell to display the
way you want

Cells(27,2) = cdbl(Textbox4.Text)
cells(27,2).Numberformat = "$ #,##0.00"
 
Tom, I value your time and I appreciate your help. You have helped me a few
times in the past, and I am thankful for your assistance. I know that you
know Excel at a level others only aspire to, so I am thinking I misunderstood
your directions. I am still struggling with how to use this:
cells(27,2).Numberformat = "$ #,##0.00"


I am trying to get the formatting to occur in the UserForm before it is sent
to a worksheet. When I enter 1000000 into a TextBox, I would like to see
$1,000,000 as soon as I click out of the TextBox, or tab to another box, or
something of that nature. Can this be done?

Regards,
Ryan---
 
Well, your answer to Aiden didn't seem to say that. Nonetheless,

TextBox4.Text=Format(cdbl(Textbox4.Text), "$#,##0.00")

Put that in the Exit event of the textbox.
 
That’s it! Thanks so much Tom!! I knew the issue would be resolved when you
got involved!! Also, thanks for the assistance with previous problems. I’ve
read through almost all of the Excel Programming DGs and the Excel Worksheet
Functions DGs. I’ve learned a lot from you and others that come here. I’ve
learned so much at this point…it’s almost inconceivable... Anyway, thanks.
 

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

Back
Top