ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Remove spaces between items in a dropdown list (https://www.excelbanter.com/excel-programming/429683-remove-spaces-between-items-dropdown-list.html)

Michael Lanier

Remove spaces between items in a dropdown list
 
I have dropdown lists (Data Validation List) that reflect spaces
between items. A list with the range of A1:A6 before zeros are hidden
may look like this:

Apples
Oranges
0
0
Lemons
0

I would like for the list to look like this:

Apples
Oranges
Lemons
0
0
0

Can someone suggest a macro for this? Thanks.

Michael

Patrick Molloy

Remove spaces between items in a dropdown list
 
hidden rows will still appear in your validation dropdown

you could delete the rows with zeros. or copy the 'good' names to a new
table and use that in your validation

"Michael Lanier" wrote in message
...
I have dropdown lists (Data Validation List) that reflect spaces
between items. A list with the range of A1:A6 before zeros are hidden
may look like this:

Apples
Oranges
0
0
Lemons
0

I would like for the list to look like this:

Apples
Oranges
Lemons
0
0
0

Can someone suggest a macro for this? Thanks.

Michael




All times are GMT +1. The time now is 06:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com