I have a feeling this is absurdly simple
I have a listbox with a dynamic named range (created with OFFSET) in the ListFillRange. It appears to be the case that when the number of items in the ListFillRange increases, the .ListCount increases to account for it. But when the number of items decreases, the .ListCount doesn't come back down, leading to a box with blank rows at the end and (worse) errors in some of my code if one of those entries is selected.
I have the number of items in the list (the length of the OFFSET) and I'd just like to add a line of code to my ListBox_Change event. Something like:
But VB doesn't seem to like it and I'm now wondering if I have to populate the list manually, etc. etc. I'd rather not just because I'm a VBA beginner and something that ought to take 10 minutes will take 3 hours. Is there any version of the above code that can do the job?![]()
Listbox1.ListCount := Worksheets("parameters").Cells(2,4).Value
Thanks!
Bookmarks