Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default Excel 97 VBA: Binding a combo to a named range

In the past when using combo boxes I've added items to
them using the add method.

I'd like to reference a named range from a separate stand
alone spreadsheet, so that I can provide a combobox that
has values that can be maintained separately.

I can't work out how one binds a combo in this way? Can
anyone help?


Many thanks


David
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Excel 97 VBA: Binding a combo to a named range

Hi David:

Just right-click on the ComboBox to access its properties, and then set the
RowSource (or ListFillRange) property to the string rpresenting the source
range address. Or, in code:

ComboBox1.RowSource = "Sheet2!A1:A10"

Regards,

Vasant.


"David" wrote in message
...
In the past when using combo boxes I've added items to
them using the add method.

I'd like to reference a named range from a separate stand
alone spreadsheet, so that I can provide a combobox that
has values that can be maintained separately.

I can't work out how one binds a combo in this way? Can
anyone help?


Many thanks


David



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default Excel 97 VBA: Binding a combo to a named range

Thanks very much Vasant.

I can get that to work but I was trying to reference a
named range. This is what I've got but it doesn't work:
ComboBox1.RowSource = Range("test")

"test" is the name of a range in the current book. Ideally
I would like to reference a range in a separate standalone
book.

-----Original Message-----
Hi David:

Just right-click on the ComboBox to access its

properties, and then set the
RowSource (or ListFillRange) property to the string

rpresenting the source
range address. Or, in code:

ComboBox1.RowSource = "Sheet2!A1:A10"

Regards,

Vasant.


"David" wrote in

message
...
In the past when using combo boxes I've added items to
them using the add method.

I'd like to reference a named range from a separate

stand
alone spreadsheet, so that I can provide a combobox that
has values that can be maintained separately.

I can't work out how one binds a combo in this way? Can
anyone help?


Many thanks


David



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Excel 97 VBA: Binding a combo to a named range

David,

Need to use a String
ComboBox1.RowSource = Range("test").Address

May need to qualify the worksheet
ComboBox1.RowSource = Sheets("Sheet1").Range("test").Address

--
sb
"David" wrote in message
...
Thanks very much Vasant.

I can get that to work but I was trying to reference a
named range. This is what I've got but it doesn't work:
ComboBox1.RowSource = Range("test")

"test" is the name of a range in the current book. Ideally
I would like to reference a range in a separate standalone
book.

-----Original Message-----
Hi David:

Just right-click on the ComboBox to access its

properties, and then set the
RowSource (or ListFillRange) property to the string

rpresenting the source
range address. Or, in code:

ComboBox1.RowSource = "Sheet2!A1:A10"

Regards,

Vasant.


"David" wrote in

message
...
In the past when using combo boxes I've added items to
them using the add method.

I'd like to reference a named range from a separate

stand
alone spreadsheet, so that I can provide a combobox that
has values that can be maintained separately.

I can't work out how one binds a combo in this way? Can
anyone help?


Many thanks


David



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Excel 97 VBA: Binding a combo to a named range

ComboBox1.RowSource = Sheets("Sheet1").Range("test").Address(external:=t rue)

Will include the worksheet name in the string. (along with the workbook name,
too.)

steve wrote:

David,

Need to use a String
ComboBox1.RowSource = Range("test").Address

May need to qualify the worksheet
ComboBox1.RowSource = Sheets("Sheet1").Range("test").Address

--
sb
"David" wrote in message
...
Thanks very much Vasant.

I can get that to work but I was trying to reference a
named range. This is what I've got but it doesn't work:
ComboBox1.RowSource = Range("test")

"test" is the name of a range in the current book. Ideally
I would like to reference a range in a separate standalone
book.

-----Original Message-----
Hi David:

Just right-click on the ComboBox to access its

properties, and then set the
RowSource (or ListFillRange) property to the string

rpresenting the source
range address. Or, in code:

ComboBox1.RowSource = "Sheet2!A1:A10"

Regards,

Vasant.


"David" wrote in

message
...
In the past when using combo boxes I've added items to
them using the add method.

I'd like to reference a named range from a separate

stand
alone spreadsheet, so that I can provide a combobox that
has values that can be maintained separately.

I can't work out how one binds a combo in this way? Can
anyone help?


Many thanks


David


.


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel 97 VBA: Binding a combo to a named range

Thanks very much guys


"Dave Peterson" wrote in message
...
ComboBox1.RowSource =

Sheets("Sheet1").Range("test").Address(external:=t rue)

Will include the worksheet name in the string. (along with the workbook

name,
too.)

steve wrote:

David,

Need to use a String
ComboBox1.RowSource = Range("test").Address

May need to qualify the worksheet
ComboBox1.RowSource = Sheets("Sheet1").Range("test").Address

--
sb
"David" wrote in message
...
Thanks very much Vasant.

I can get that to work but I was trying to reference a
named range. This is what I've got but it doesn't work:
ComboBox1.RowSource = Range("test")

"test" is the name of a range in the current book. Ideally
I would like to reference a range in a separate standalone
book.

-----Original Message-----
Hi David:

Just right-click on the ComboBox to access its
properties, and then set the
RowSource (or ListFillRange) property to the string
rpresenting the source
range address. Or, in code:

ComboBox1.RowSource = "Sheet2!A1:A10"

Regards,

Vasant.


"David" wrote in
message
...
In the past when using combo boxes I've added items to
them using the add method.

I'd like to reference a named range from a separate
stand
alone spreadsheet, so that I can provide a combobox that
has values that can be maintained separately.

I can't work out how one binds a combo in this way? Can
anyone help?


Many thanks


David


.


--

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
Excel Data Validation Combo box using Named Ranges Robcole84 Excel Discussion (Misc queries) 1 February 17th 10 10:33 PM
inserting a named range into new cells based on a named cell Peter S. Excel Discussion (Misc queries) 1 June 4th 06 03:53 AM
combo box named range BB Excel Discussion (Misc queries) 2 June 21st 05 04:27 PM
Paste a named range to another range in Excel David Jean Excel Discussion (Misc queries) 2 April 13th 05 02:02 PM
DAO objects with late binding in Excel? Chris Excel Programming 0 August 21st 03 07:28 PM


All times are GMT +1. The time now is 02:33 PM.

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"