Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Text Box - Control Source
I have a text box control on a userform I'd like the text box to display the contents of a worksheet range A2- A10. It's not clear where this goes in the text box properties. What is 'Control Source' and what value goes there? Help gives me a listbox example. Also where does the Worksheet name go? Thanks - Kirk |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Text Box - Control Source
Hi Kirk,
ControlSource only accepts a single location or cell, so you can't use that for your multi-cell source. Private Sub UserForm_Click() ' probably in the initialize event ' set the tb's MultiLine property to true Dim i&, s$ For i = 2 To 10 s = s & ActiveSheet.Cells(i, 1) If i < 10 Then s = s & vbCr Next Me.TextBox2.Text = s End Sub ControlSource is normally a two way link, if that's what you need then look at the textbox AfterUpdate event to write changes back to cells, might need the Split function. Perhaps a ListBox might better suit your needs to link multi-cells with RowSource. Regards, Peter T "kirkm" wrote in message ... I have a text box control on a userform I'd like the text box to display the contents of a worksheet range A2- A10. It's not clear where this goes in the text box properties. What is 'Control Source' and what value goes there? Help gives me a listbox example. Also where does the Worksheet name go? Thanks - Kirk |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Syntax for control source in combo box control | Excel Discussion (Misc queries) | |||
text boxes & control source | Excel Programming | |||
How do I format a text box control to display the source in time . | Excel Programming | |||
Text boxes and control source | Excel Programming | |||
Text Box Control Source | Excel Programming |