Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 118
Default Excel VBA Multi Column ComboBox

What you do is initialise the array as a dynamic array with the Dim statement
as below. Then run your procedure to count the number of rows. Now use the
"ReDim" statement to set the array size and then fill the array as required.

Sub MySub()
Dim MyArray()

<Your function to count the rows

ReDim MyArray (1 To NumberofRows, 1 To 4)

<Your function to fill array

ComboBox1.List = MyArray
End Sub

If this helps please click "Yes"
<<<<<<<<<<

"jlclyde" wrote:

How do you do this if it is not a fixed number of rows? I never know
how many items are going to be in a column until the macro starts
countign them. For instance I have a range of items down A starting
from 52 and going to the end of the sheet. I want to list all item
Numbers which will be every 4th row and the rest of the columns are
offset from this number. Hwo woudl I set the Array if I do nto knwo
how far down it goes?

Thanks,
Jay


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
Converting a Word doc to a multi-column Excel spreadsheet DD Pgh Excel Worksheet Functions 0 January 12th 09 06:42 PM
fill combobox depending on selection from another combobox Adam Francis Excel Discussion (Misc queries) 2 July 24th 08 07:39 PM
How do I make multi column stacked graphs in Excel Ed B Charts and Charting in Excel 1 October 20th 07 11:40 AM
match in multi-column and multi-row array sloth Excel Discussion (Misc queries) 14 September 1st 06 10:33 PM
Selecting any cell in a column I want my ComboBox to show. How? ABP MLundqvist Excel Discussion (Misc queries) 4 March 1st 06 01:15 PM


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