Formatting text boxes

Mkammari

Board Regular
Joined
Nov 23, 2005
Messages
65
I am using a vba userform to display information that already exists on an excel worksheet entitled "Customer Info". Currently, I am having a very hard time trying to get the userform to display any kind of number formatting. I was using the control source to display the information on the userform but had problems. So then, I tried to code the data in VBA initializing, but still could not get it to work.

Here is one example of my coding in the userform initializing stage.

Code:
TxtWeightLow.text = Sheets("customerinfo").Range("b95").Text

Is there another line I would need to add to format the text box. (the cell on the spreadsheet is already formatted)

I would like txtweightlow to read as a ($* #,##0.00_)
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
That code should display B95 in the textbox as it is formatted on the worksheet.

Have you removed the value in the ControlSource property?
 
Upvote 0
Not really sure what's going on now. I took the control source, the value, and the text out of the properties menu and now I'm not returning a value in the text box.

But the code I provided should return the value exactly displayed in the worksheet. Is that what you are saying?
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top