Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Text box in form
Hi guys I have a text box in a user form that take is linked to sheet1! G3 But G3 had the formula that works out the prices from different sheets and show the answer. I can only seem to use the text box once it shows the number but Deletes the formula and just leaves the figure in the cell G3 I just need the text box as a display box? Also i can not seem to get the text box to display £ and the 0 on the end of pence e.g. 123.1 and it should be £123.10 Thanks for your help -- raw ------------------------------------------------------------------------ raw's Profile: http://www.excelforum.com/member.php...o&userid=28312 View this thread: http://www.excelforum.com/showthread...hreadid=479531 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Text box in form
Good evening raw We can solve both of these with one line of code: TextBox1.Text = Format(Range("Sheet1!G3").Value, "£#,###.00") However, this is probably a bit of a diversion to the way you've probably done it, especially if you've linked the textbox to the value property, but this is the better way to go. If you struggle to implement this post back and we'll take it from there. HTH DominicB -- dominicb ------------------------------------------------------------------------ dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932 View this thread: http://www.excelforum.com/showthread...hreadid=479531 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Text box in form
Hi Thanks for the code This maybe a stupied question but where do you put this code? Thanks -- raw ------------------------------------------------------------------------ raw's Profile: http://www.excelforum.com/member.php...o&userid=28312 View this thread: http://www.excelforum.com/showthread...hreadid=479531 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Text box in form
Hi raw Well, it really depends on how your spreadsheet is set up. Say, you're using UserForm1 and your textbox is called TextBox1 and you have a macro calling Userform1: Sub Test() UserForm1.Show End Sub From the VBE double click on the UserForm you've designed and copy this code into the pane that opens: Private Sub UserForm_Initialize() TextBox1.Text = Format(Range("Sheet1!G3").Value, "£#,###.00") End Sub Now, when you run the macro "Test", UserForm1 should open and TextBox1 will contain the value of G3 formatted in £ and pence. HTH DominicB -- dominicb ------------------------------------------------------------------------ dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932 View this thread: http://www.excelforum.com/showthread...hreadid=479531 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Text box in form
Hi Thanks for that Worked Thank you -- raw ------------------------------------------------------------------------ raw's Profile: http://www.excelforum.com/member.php...o&userid=28312 View this thread: http://www.excelforum.com/showthread...hreadid=479531 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Text box in form
Hi raw You're welcome. Thanks for the feedback. DominicB -- dominicb ------------------------------------------------------------------------ dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932 View this thread: http://www.excelforum.com/showthread...hreadid=479531 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
2 criteria lookup of text. Return text form column 3. SUMPRODUCT t | Excel Worksheet Functions | |||
DATE IN TEXT FORM - NEED TO CHANGE IT DATE FORM | New Users to Excel | |||
Formatting text in a user form text box | Excel Programming | |||
VBA - Form Text box value | Excel Programming | |||
text box on a form | Excel Programming |