ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Blank spaces in a listbox (https://www.excelbanter.com/excel-discussion-misc-queries/40623-blank-spaces-listbox.html)

Soundman

Blank spaces in a listbox
 

Hi all,

I've got a userform with a listbox. In the properties, I've selected
the row source & it works as expected. My problem is when I delete an
item out of the middle of that list, the listbow shows a blank space
instead of skipping it. I've looked at all of the properties & there
doesn't seem to be one that works on this, so I tried assigning the row
source range in VBE, but I kept getting a message that the object was
already in another module.

Does anyone have an efficient way to fix this?

Thanks


--
Soundman
------------------------------------------------------------------------
Soundman's Profile: http://www.excelforum.com/member.php...o&userid=24428
View this thread: http://www.excelforum.com/showthread...hreadid=396117


Jim Rech

Did you delete a row or merely clear the cell? You must do the former.
Also, be sure to assign a name to the list range and use the name as a
RowSource. A cell address Rowsource like A1:A10 will not adjust if you
delete a row in it, whereas a named range will.

--
Jim
"Soundman" wrote in
message ...
|
| Hi all,
|
| I've got a userform with a listbox. In the properties, I've selected
| the row source & it works as expected. My problem is when I delete an
| item out of the middle of that list, the listbow shows a blank space
| instead of skipping it. I've looked at all of the properties & there
| doesn't seem to be one that works on this, so I tried assigning the row
| source range in VBE, but I kept getting a message that the object was
| already in another module.
|
| Does anyone have an efficient way to fix this?
|
| Thanks
|
|
| --
| Soundman
| ------------------------------------------------------------------------
| Soundman's Profile:
http://www.excelforum.com/member.php...o&userid=24428
| View this thread: http://www.excelforum.com/showthread...hreadid=396117
|



Dave O

How about a quick bit of code that runs on startup and sorts the
relevant range?


Soundman


Thanks for your help. I'll give it a try.


--
Soundman
------------------------------------------------------------------------
Soundman's Profile: http://www.excelforum.com/member.php...o&userid=24428
View this thread: http://www.excelforum.com/showthread...hreadid=396117



All times are GMT +1. The time now is 04:41 AM.

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