Hello everyone.
I have a macro that fills a list box box based on the data which is in another combo box. The code is as follows:
This works fine, but only if the User Data sheet is active. I would like to to work regardless. Any ideas?
-Ilya
I have a macro that fills a list box box based on the data which is in another combo box. The code is as follows:
Code:
Dim MyCell Range
Dim wUD As Worksheet
Set wUD = sheets("User Data")
For Each MyCell In wUD.Range("z2:z" & Range("A65536").End(xlUp).Row)
If Not MyCell = "" Then
With iPeerGroup
.AddItem (MyCell.Offset(0, -25).Value)
.List(.ListCount - 1, 1) = MyCell.Offset(0, -24).Value
.List(.ListCount - 1, 2) = Format(MyCell, "#,#")
End With
End If
Next
-Ilya