Rob342
07-07-2013, 12:48 PM
Hi All
I have a single select listbox, which I am trying to remove the selected item, But keep getting an undefined error, I have since found out that you cannot remove an item if the rowsource is used
The range used is a defined range called SRErrCode
This is the code that I had to load the listbox
Case "Service Reception"
With Me.LBAuditP4
.RowSource = "AC!V2:AD8"
.ColumnCount = 9
.ColumnHeads = True
.ColumnWidths = "30pt;500pt;30pt;40pt;40pt;40pt;40pt;40pt;40pt"
End With
This is what I changed it to
Case "Service Reception"
With Me.LBAuditP4
For i = 1 To 6
.AddItem ws.Range("SRErrCode").cells(.ListIndex + 2, i).Value
Next i
The 2nd piece of code only loads The 1st cell, how can I get it to load all 9 cells ( col V2 to V8) on each line of the listbox
I can remove the item selected when the above code is used
Is there a better way to load the listbox?
Any help would be most appreciated
Rob
I have a single select listbox, which I am trying to remove the selected item, But keep getting an undefined error, I have since found out that you cannot remove an item if the rowsource is used
The range used is a defined range called SRErrCode
This is the code that I had to load the listbox
Case "Service Reception"
With Me.LBAuditP4
.RowSource = "AC!V2:AD8"
.ColumnCount = 9
.ColumnHeads = True
.ColumnWidths = "30pt;500pt;30pt;40pt;40pt;40pt;40pt;40pt;40pt"
End With
This is what I changed it to
Case "Service Reception"
With Me.LBAuditP4
For i = 1 To 6
.AddItem ws.Range("SRErrCode").cells(.ListIndex + 2, i).Value
Next i
The 2nd piece of code only loads The 1st cell, how can I get it to load all 9 cells ( col V2 to V8) on each line of the listbox
I can remove the item selected when the above code is used
Is there a better way to load the listbox?
Any help would be most appreciated
Rob