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

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
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,224,823
Messages
6,181,185
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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