Hi all,
I fill my listbox with the following columns from the sheet BMR data;
I use the following code for it;
Now it showing all columns and data from B, C and D.
Is it possible to code it like i can tell wich columns to show?
I would like to show Column B, D and E and exclude column C.
I fill my listbox with the following columns from the sheet BMR data;
Tracker QA on the floor New.xlsm | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | 2022 | ||||||
2 | Month | Maand | In | Out | |||
3 | October | October 22 | 96 | 93 | |||
4 | November | 157 | 133 | ||||
5 | December | 99 | 113 | ||||
BMR data |
I use the following code for it;
VBA Code:
Option Explicit
Dim Ary As Variant
Private Sub UserForm_Initialize()
Ary = Sheets("BMR data").Range("B3", Sheets("BMR data").Range("B" & Rows.Count).End(xlUp).Offset(, 7)).Value
With Me.lstSearchResults
.ColumnCount = 4
.ColumnWidths = "150;70;48;48"
.List = Ary
End With
End sub
Now it showing all columns and data from B, C and D.
Is it possible to code it like i can tell wich columns to show?
I would like to show Column B, D and E and exclude column C.