PDA

View Full Version : Solved: Option button and text box



whitewidow
02-18-2007, 07:11 PM
I am trying to get my program to read from excel worksheet.

i have a option button and a text box when i select that option button then the text box should display the charters on excel worksheet.

i cant figure out how to do this right coding for this.

mdmackillop
02-19-2007, 01:42 AM
There's a step by step tutorial on userforms here (http://www.contextures.com/xlUserForm01.html).

whitewidow
02-19-2007, 01:52 AM
There's a step by step tutorial on userforms here (http://www.contextures.com/xlUserForm01.html).

this sort of tutorial is not what i need, i have some coding but cant get it to work

tpoynton
02-19-2007, 05:46 AM
How about posting the workbook? It will be much more straightforward for folks here to help you if you provide 'sample data and layout', as MD says in his sig

lucas
02-19-2007, 07:27 AM
Private Sub OptionButton1_Click()
Me.textbox1.Value = Range("c10").Value
End Sub

whitewidow
02-19-2007, 02:48 PM
but what i need to do is the out put should be in this sort of format (example ) ?250,000
how would i be doing this sort of format in the coding

mdmackillop
02-19-2007, 03:19 PM
Private Sub OptionButton1_Click()
Me.TextBox1.Text = Format(Range("C10"), "?#,###,##0")
End Sub

BTW, unless you want input to the textbox, you should consider using the Caption property of a Label to return values.

whitewidow
02-19-2007, 04:06 PM
thank you very much mdmackillop (http://www.vbaexpress.com/forum/member.php?u=87) i have figured out on how to do it