Empty space/gap at end of drop down list selection

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,832
Office Version
  1. 2007
Platform
  1. Windows
Morning,

When i click the drop down arrow on a Combobox i see the only one option to select of which in this case is N/A
But below that option there is a empty space/gap.

Please advise how this can be remove.
Here is some info to assist you.

Code for the Combobox.
Code:
'INVOICE NUMBERDim lastroww As Long
lastroww = Sheets("INFO").Cells(Rows.Count, "W").End(xlUp).Row
ComboBox13.List = Sheets("INFO").Cells(2, "W").Resize(lastroww).Value

The table on the worksheet is,
Column W
Header in cell W1
N/A is then in cell W2


If you need more info please advise.

Thanks
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Hi,
If you mean like the below that gives me an error of,
RTE 31
Could not set the list property, Invalid property array Index.

Code:
'INVOICE NUMBERDim lastroww As Long
lastroww = Sheets("INFO").Cells(Rows.Count, "W").End(xlUp).Row
ComboBox13.List = Sheets("INFO").Cells(2, "W").Resize(lastroww - 1).Value
 
Upvote 0
Afternoon,

Anybody see why this space / gap is present or why when i enter -1 to the code as advised above throws up the error message.

Thanks
 
Upvote 0
As your list starts in row 2 you need to use Lastrow-1 to remove the blank space, but .List needs an array, so if you only have one value value in col W you get the error.
 
Upvote 0
I will check once home but I think I did try it on another list which had plenty in and was the same.
 
Upvote 0
Fluff you are correct.
I have checked & added the -1 to those with more than 1 entry

Thanks very much
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

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