Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Combo Box ListRows property; changing programmatically

Does anyone know how to programmatically change the ListRows property of a
Combo Box?

Using VBA I would like to run a Distinct query against a DB (which I can
do). That query will return values to a Dynamic Named Range, whose Row Count
provides the value for the ListRows property of a Combo Box (with a preset
maximum of 20).

Thanks for your assistance in this regard.

Michael
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Combo Box ListRows property; changing programmatically

I am not 100% sure exactly what you are trying to do but here is ssome code
to change the ListRows property...

ComboBox1.ListRows = 8
or
ComboBox1.ListRows = range("MyRange").rows.count
--
HTH...

Jim Thomlinson


"GPDynamics" wrote:

Does anyone know how to programmatically change the ListRows property of a
Combo Box?

Using VBA I would like to run a Distinct query against a DB (which I can
do). That query will return values to a Dynamic Named Range, whose Row Count
provides the value for the ListRows property of a Combo Box (with a preset
maximum of 20).

Thanks for your assistance in this regard.

Michael

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Combo Box ListRows property; changing programmatically

I have an issue similar to the original question. I am trying to dynamically
change th size of a combo box (from the Control Toolbox toolbar) using a
variable representing the size of a range on a worksheet. I tried the
suggestion to the original question below in the following code (code is in a
module; the combobox is embedded on a worksheet, not on a form):

Attempt 1:
ActiveSheet.Shapes("cmbCurrentbirthdays").Select
With Selection
.ListFillRange = "'Birthdays'!Fillrange"
.ListRows = 8

End With

Attempt 2:
ActiveSheet.Shapes("cmbCurrentbirthdays").ListRows =
Range("fillrange").Rows.Count

Both attempts usng the .ListRows statement give me the same error "Run-time
error '438': Object doesn't support this property or method"

Any ideas what I'm doing wrong? Appreicate any help!
WB


"Jim Thomlinson" wrote:

I am not 100% sure exactly what you are trying to do but here is ssome code
to change the ListRows property...

ComboBox1.ListRows = 8
or
ComboBox1.ListRows = range("MyRange").rows.count
--
HTH...

Jim Thomlinson


"GPDynamics" wrote:

Does anyone know how to programmatically change the ListRows property of a
Combo Box?

Using VBA I would like to run a Distinct query against a DB (which I can
do). That query will return values to a Dynamic Named Range, whose Row Count
provides the value for the ListRows property of a Combo Box (with a preset
maximum of 20).

Thanks for your assistance in this regard.

Michael

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
Changing formula programmatically Mark Excel Programming 1 April 12th 05 02:15 PM
Combo box property Dan Excel Programming 2 October 28th 04 08:14 PM
Changing DSN programmatically? Michael Bourgon Excel Programming 1 October 21st 04 10:44 AM
Programmatically create combo boxes Richard[_31_] Excel Programming 1 August 12th 04 03:10 AM
listrows property jim C. Excel Programming 3 August 12th 03 05:28 AM


All times are GMT +1. The time now is 03:04 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"