Variable ranges in dropdown list

ElvisSteel

Board Regular
Joined
Mar 23, 2009
Messages
122
I need to define a dropdown list (either using a combo box or an in-cell dropdown) but the input range (which contains 10 cells) will not always be fully populated. I tried to define a variable range name using offset to only include populated cells, but I can't get it to work.
Details are:
Cells A1:A10 contain data, but not always full, i.e. sometimes only data in A1:A5 or A1:A8 etc. A1:A10 is named as "InputData"
Cell D1 originally set up with data validation with List on range "=InputData" , but this means blanks can be selected when InputData not full. I then tried to define InputData as "=Offset($A$1,0,0,COUNTA(A1:A10),1)" but the dropdown then shows only blanks.
Any help greatly appreciated.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

xlHammer

Board Regular
Joined
Apr 7, 2008
Messages
215
I tried this putting $ signs around the range,

=Offset($A$1,0,0,COUNTA($A$1:$A$10),1)

and it seemed to work ok

any help?
 

Watch MrExcel Video

Forum statistics

Threads
1,133,649
Messages
5,660,113
Members
418,550
Latest member
kp_

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
Top