Posting a $ sign in a textbox?

Todd_M

Board Regular
Joined
Feb 24, 2002
Messages
117
Hi-
Textbox1 shows the number listed in range(A1").

Private sub userform1.activate
textbox1.text = range(A1")
end sub

My question is how do you show that if range "A1" reads $1.23, then I want textbox1 to read $1.23 and not 1.2333333 upon activating the textbox?
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
you could try:

textbox1.text = Format(range(A1"),"$#,##0.00")

But beware, if youre doing any calculations, this will be a problem (as i found the hard way) and will take some undoing later. The format turns the value into a string.
 
Upvote 0
Thanks Robfo1- This worked. Im asuming that if theres a code thats reading textbox1 its reading it as a string instead of a value? How did you go about in correcting that problem?
 
Upvote 0
You can link a text box to a range without using VBA by clicking on the text box and typing "=A1" in the formula bar. The contents of cell A1 (including its format) will be displayed in the text box. Format cell A1 as $.
 
Upvote 0

Forum statistics

Threads
1,213,552
Messages
6,114,278
Members
448,560
Latest member
Torchwood72

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