PC Review


Reply
Thread Tools Rate Thread

ComboBox RowSource

 
 
Caleb Runnels
Guest
Posts: n/a
 
      22nd Jul 2007
I am trying to populate a ComboBox RowSource in a form with a named range
from another workbook. I'm a little stumped. Any suggestions?


 
Reply With Quote
 
 
 
 
=?Utf-8?B?SkxHV2hpeg==?=
Guest
Posts: n/a
 
      22nd Jul 2007
Here is one that I use in a procedure. It uses a variable length row source.

Private Sub UserForm_Initialize()
With Worksheets(3)
maxRw = .Cells(Rows.Count, 1).End(xlUp).Row
x = .Cells(maxRw, 1).Address
UserForm3.Caption = "SELECT STREET NAME"
With UserForm3.ListBox1
.RowSource = "Sheet3!$A$2:" & x 'This refers to other sheet range
.BoundColumn = 1
.ColumnCount = 1
.ListStyle = fmListStyleOption
End With
End With
End Sub


"Caleb Runnels" wrote:

> I am trying to populate a ComboBox RowSource in a form with a named range
> from another workbook. I'm a little stumped. Any suggestions?
>
>
>

 
Reply With Quote
 
Caleb Runnels
Guest
Posts: n/a
 
      22nd Jul 2007
It's not quite exactly what I'm trying to do. That example would work fine
if I needed to use a different sheet in the same workbook, but I need to use
a complete different workbook...aka...different Excel file.


"JLGWhiz" <(E-Mail Removed)> wrote in message
news:F5D06741-FDCF-4971-A330-(E-Mail Removed)...
> Here is one that I use in a procedure. It uses a variable length row
> source.
>
> Private Sub UserForm_Initialize()
> With Worksheets(3)
> maxRw = .Cells(Rows.Count, 1).End(xlUp).Row
> x = .Cells(maxRw, 1).Address
> UserForm3.Caption = "SELECT STREET NAME"
> With UserForm3.ListBox1
> .RowSource = "Sheet3!$A$2:" & x 'This refers to other sheet range
> .BoundColumn = 1
> .ColumnCount = 1
> .ListStyle = fmListStyleOption
> End With
> End With
> End Sub
>
>
> "Caleb Runnels" wrote:
>
>> I am trying to populate a ComboBox RowSource in a form with a named range
>> from another workbook. I'm a little stumped. Any suggestions?
>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      22nd Jul 2007
Assuming the other workbook is open then:

..RowSource =
workbooks("Otherbook.xls").Names("MyName").ReferstoRange(0,0,xlA1,True)

--
Regards,
Tom Ogilvy


"Caleb Runnels" wrote:

> It's not quite exactly what I'm trying to do. That example would work fine
> if I needed to use a different sheet in the same workbook, but I need to use
> a complete different workbook...aka...different Excel file.
>
>
> "JLGWhiz" <(E-Mail Removed)> wrote in message
> news:F5D06741-FDCF-4971-A330-(E-Mail Removed)...
> > Here is one that I use in a procedure. It uses a variable length row
> > source.
> >
> > Private Sub UserForm_Initialize()
> > With Worksheets(3)
> > maxRw = .Cells(Rows.Count, 1).End(xlUp).Row
> > x = .Cells(maxRw, 1).Address
> > UserForm3.Caption = "SELECT STREET NAME"
> > With UserForm3.ListBox1
> > .RowSource = "Sheet3!$A$2:" & x 'This refers to other sheet range
> > .BoundColumn = 1
> > .ColumnCount = 1
> > .ListStyle = fmListStyleOption
> > End With
> > End With
> > End Sub
> >
> >
> > "Caleb Runnels" wrote:
> >
> >> I am trying to populate a ComboBox RowSource in a form with a named range
> >> from another workbook. I'm a little stumped. Any suggestions?
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      22nd Jul 2007
Just a typo alert:

..RowSource = workbooks("Otherbook.xls").Names("MyName") _
.ReferstoRange.address(0,0,xlA1,True)

(added .address)

Tom Ogilvy wrote:
>
> Assuming the other workbook is open then:
>
> .RowSource =
> workbooks("Otherbook.xls").Names("MyName").ReferstoRange(0,0,xlA1,True)
>
> --
> Regards,
> Tom Ogilvy
>
> "Caleb Runnels" wrote:
>
> > It's not quite exactly what I'm trying to do. That example would work fine
> > if I needed to use a different sheet in the same workbook, but I need to use
> > a complete different workbook...aka...different Excel file.
> >
> >
> > "JLGWhiz" <(E-Mail Removed)> wrote in message
> > news:F5D06741-FDCF-4971-A330-(E-Mail Removed)...
> > > Here is one that I use in a procedure. It uses a variable length row
> > > source.
> > >
> > > Private Sub UserForm_Initialize()
> > > With Worksheets(3)
> > > maxRw = .Cells(Rows.Count, 1).End(xlUp).Row
> > > x = .Cells(maxRw, 1).Address
> > > UserForm3.Caption = "SELECT STREET NAME"
> > > With UserForm3.ListBox1
> > > .RowSource = "Sheet3!$A$2:" & x 'This refers to other sheet range
> > > .BoundColumn = 1
> > > .ColumnCount = 1
> > > .ListStyle = fmListStyleOption
> > > End With
> > > End With
> > > End Sub
> > >
> > >
> > > "Caleb Runnels" wrote:
> > >
> > >> I am trying to populate a ComboBox RowSource in a form with a named range
> > >> from another workbook. I'm a little stumped. Any suggestions?
> > >>
> > >>
> > >>

> >
> >
> >


--

Dave Peterson
 
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
ComboBox.RowSource? JimAnAmateur Microsoft Excel Programming 15 28th Mar 2007 01:21 AM
VBA combobox rowsource kirke Microsoft Excel Discussion 2 13th Sep 2006 10:45 AM
Combobox rowsource based on value of other combobox =?Utf-8?B?UmljaCBK?= Microsoft Access Form Coding 0 9th Nov 2004 10:15 PM
How Do I Load A ComboBox RowSource From The Results Of Another ComboBox Minitman Microsoft Excel Programming 3 26th Oct 2004 07:58 PM
combobox rowsource =?Utf-8?B?TmV3Ymll?= Microsoft Excel Programming 1 8th Sep 2004 12:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:49 AM.