Using dynamic ranges to populate combobox

hungledink

Board Regular
Joined
Feb 20, 2012
Messages
88
Office Version
  1. 365
I have a combobox in a userform which takes its values form a dynamic range using this formula


=OFFSET($A$1,0,0,COUNT($A:$A),1)


This works ok but I want to add rows with new data at the start of this list, and include this new data in the combobox. When I do this though it corrupts the formula.


If I add one row in row 1:1 then the formula changes to say =OFFSET($A$2,0,0,COUNT($A:$A),1)


How do I get round this issue?


Thanks in advance.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Try...

=OFFSET(INDEX($A:$A,1),0,0,COUNT($A:$A),1)

Hope this helps!
 
Upvote 0
Alternatively, populate the Combobox like this...

Code:
 ComboBox1.RowSource = ""
 ComboBox1.List = ActiveSheet.Range("A1", ActiveSheet.Range("A" & Rows.Count).End(xlUp)).Value
 
Upvote 0
Alternatively, populate the Combobox like this...

Code:
 ComboBox1.RowSource = ""
 ComboBox1.List = ActiveSheet.Range("A1", ActiveSheet.Range("A" & Rows.Count).End(xlUp)).Value


Thanks, this works nicely.

This formula: =OFFSET(INDEX($A:$A,1),0,0,COUNT($A:$A),1) : just seemed to create a blank combobox but the correct number of blank lines in that combobox if that makes sense.
 
Upvote 0
This formula: =OFFSET(INDEX($A:$A,1),0,0,COUNT($A:$A),1) : just seemed to create a blank combobox but the correct number of blank lines in that combobox if that makes sense.

If you insert a number of rows and leave those cells blank, you'll get blank entries in the ComboBox. Is this the case?
 
Upvote 0

Forum statistics

Threads
1,224,732
Messages
6,180,624
Members
452,991
Latest member
JM_000888

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top