PC Review


Reply
Thread Tools Rate Thread

DataSource for ComboBox in UserForm

 
 
Stuart Grant
Guest
Posts: n/a
 
      9th Sep 2007
I have a user form in a worksheet with several text boxes and a combobox. I
cannot find how to make the data source of the combobox a column in another
worksheet.
John Walkenbach's Excel 2003 Bible say that a combobox in a userform has a
ListFillRange but it doesn't seem to have - only Data Source.
I tried putting "=Trandesc!Range("A1:A66") as the Data Source but this gives
an error message.
Can someone put me right ?
Stuart


 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      9th Sep 2007
It's really a userform, right?

If yes, then look for .rowsource in the properties window.
And use: trandesc!a1:a66

You can also do it in code:


Stuart Grant wrote:
>
> I have a user form in a worksheet with several text boxes and a combobox. I
> cannot find how to make the data source of the combobox a column in another
> worksheet.
> John Walkenbach's Excel 2003 Bible say that a combobox in a userform has a
> ListFillRange but it doesn't seem to have - only Data Source.
> I tried putting "=Trandesc!Range("A1:A66") as the Data Source but this gives
> an error message.
> Can someone put me right ?
> Stuart


--

Dave Peterson
 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      9th Sep 2007
It's really a userform, right?

If yes, then look for .rowsource in the properties window.
And use: trandesc!a1:a66

You can also do it in code:

Option Explicit
Private Sub UserForm_Initialize()
With Me.ComboBox1
.RowSource = "" 'in case you didn't clear the properties window
.RowSource = ThisWorkbook.Worksheets("Trandesc") _
.Range("a1:a66").Address(external:=True)
End Sub


Stuart Grant wrote:
>
> I have a user form in a worksheet with several text boxes and a combobox. I
> cannot find how to make the data source of the combobox a column in another
> worksheet.
> John Walkenbach's Excel 2003 Bible say that a combobox in a userform has a
> ListFillRange but it doesn't seem to have - only Data Source.
> I tried putting "=Trandesc!Range("A1:A66") as the Data Source but this gives
> an error message.
> Can someone put me right ?
> Stuart


--

Dave Peterson
 
Reply With Quote
 
Stuart Grant
Guest
Posts: n/a
 
      10th Sep 2007
Dave
Thank you very much ! It works of course
Stuart

"Dave Peterson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> It's really a userform, right?
>
> If yes, then look for .rowsource in the properties window.
> And use: trandesc!a1:a66
>
> You can also do it in code:
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: combobox datasource... Cor Ligthert [MVP] Microsoft VB .NET 0 12th Dec 2006 06:11 AM
ComboBox and Datasource Max3vil Microsoft Dot NET Framework Forms 1 21st Sep 2006 02:39 PM
ComboBox DataSource - on the fly changes? cj Microsoft C# .NET 2 19th Oct 2005 07:58 PM
comboBox datasource juli jul Microsoft C# .NET 5 27th Mar 2005 06:13 PM
ComboBox.DataSource .Net v1.1.4322: Problem to assign new datasource Stephan Microsoft Dot NET Framework 3 10th Oct 2003 08:09 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:16 PM.