Column heads disappear in filter listbox

adelvoira

New Member
Joined
Sep 9, 2017
Messages
35
HELLO,
i have this attached code below and when i click the button all the column heads disappear from the listbox and all the decimals too,
thank you

Code:
ListBox8.RowSource = EmptyListBox8.Clear
Sheets("AGENTS").Select
For Each f In Range("b2:b" & Range("b10000").End(xlUp).Row)
If f Like ComboBox9 & "*" Then
listed = ListBox8.ListCount
ListBox8.AddItem
ListBox8.List(listed, 0) = f.Offset(0, -1)
ListBox8.List(listed, 1) = f
ListBox8.List(listed, 2) = f.Offset(0, 1)
ListBox8.List(listed, 3) = f.Offset(0, 2)
ListBox8.List(listed, 4) = f.Offset(0, 3)
ListBox8.List(listed, 5) = f.Offset(0, 4)
ListBox8.List(listed, 6) = f.Offset(0, 5)
End If
With ListBox8
.ListIndex = .ListCount - 1
End With
Next
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
You can't have column headers in a listbox unless it's populated with the RowSource property and as far as I can see you are populating ListBox8 using the AddItem method.

As for the decimals going missing, I can't see anything in the posted code that would cause that - is there anything else going on?
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,314
Members
452,634
Latest member
cpostell

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