PDA

View Full Version : Solved: Display items of a collection in a message box?



Simon Lloyd
04-23-2009, 12:00 AM
Hi all, currently i am creating collections to fill comboboxes for viewing purposes, however, i really would rather show them on a message box but it doesn't accept a collection anyone know how to do it?
The variables have been declared as collections.
For Each Cel In rng
Select Case LCase(Cel.Value)
Case "Ms": Msa.Add Cells(1, Cel.Column).Value, CStr(Cells(1, Cel.Column).Value)
Case "Ks": Ksa.Add Cells(1, Cel.Column).Value, CStr(Cells(1, Cel.Column).Value)
Case "Ds": Dsa.Add Cells(1, Cel.Column).Value, CStr(Cells(1, Cel.Column).Value)
Case "Os": Osa.Add Cells(1, Cel.Column).Value, CStr(Cells(1, Cel.Column).Value)
Case "Ts": Tsa.Add Cells(1, Cel.Column).Value, CStr(Cells(1, Cel.Column).Value)
End Select
Next Cel

Bob Phillips
04-23-2009, 12:11 AM
I dson't see any collections there!



For Each colval In mycoll

msg = msg & colval & vbNewLine
Next colval
MsgBox msg

Simon Lloyd
04-23-2009, 12:25 AM
Thanks Bob, i just quickly adapted the code i posted from my userform, it's still early yet!