Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default ComboBox RowSource

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?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default ComboBox RowSource

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?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default ComboBox RowSource

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" wrote in message
...
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?





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default ComboBox RowSource

Assuming the other workbook is open then:

..RowSource =
workbooks("Otherbook.xls").Names("MyName").Referst oRange(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" wrote in message
...
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?






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default ComboBox RowSource

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").Referst oRange(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" wrote in message
...
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
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
ComboBox.RowSource? JimAnAmateur[_2_] Excel Programming 13 March 28th 07 01:21 AM
Combobox Rowsource kirke Excel Programming 5 September 21st 06 10:15 AM
Combobox rowsource Marinos Andreou Excel Programming 2 March 7th 06 05:08 PM
How Do I Load A ComboBox RowSource From The Results Of Another ComboBox Minitman[_4_] Excel Programming 3 October 26th 04 07:58 PM
combobox rowsource Newbie Excel Programming 1 September 8th 04 12:21 PM


All times are GMT +1. The time now is 10:04 AM.

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

About Us

"It's about Microsoft Excel"