Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax for control source in combo box control dhstein Excel Discussion (Misc queries) 1 August 12th 09 05:38 PM
text boxes & control source Robert Dieckmann Excel Programming 1 December 5th 05 05:58 PM
How do I format a text box control to display the source in time . patrick Excel Programming 3 February 2nd 05 05:52 PM
Text boxes and control source Welshy[_4_] Excel Programming 1 November 18th 04 12:40 PM
Text Box Control Source Richard Excel Programming 6 May 17th 04 02:17 PM


All times are GMT +1. The time now is 12:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"