Delete Blanks in List Box Form Control

Pjam

Board Regular
Joined
Jun 4, 2008
Messages
139
Hi,

Is there a way to format the List box form control so that the
validation range does not include blanks?

Im using this and it does not seem to work

=OFFSET(Assumptions!$AF$2,0,0,COUNTIF(Assumptions!$AF$2:$AF$5000,"<>"),1)
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hi,

Is there a way to format the List box form control so that the
validation range does not include blanks?

Im using this and it does not seem to work

=OFFSET(Assumptions!$AF$2,0,0,COUNTIF(Assumptions!$AF$2:$AF$5000,"<>"),1)

Are you just trying to load all values from range "AF2:AF5000" skipping any blank cells?

If so, just fill it with VBA...

i.e.

Dim myRange as Range
Dim mySheet as Worksheet

Set mySheet = Sheet1 'Change this to your sheet number
Set myRange = mySheet.Range("AF2:AF5000")

myListBox.clear

For each cell in myRange
If cell.value <> "" then
With myListBox
.add item cell.value
End With
End if
Next Cell
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,681
Members
452,937
Latest member
Bhg1984

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