L
Leanne
Hi - Beginner at code here!
I have taken this sample code from
http://www.contextures.on.ca/xlUserForm01.html#SetUp (which was a great help)
and downloaded the sample for Enhanced User forms with Combo boxes but I am
stuck on how to modify the first part.
Private Sub UserForm_Initialize()
Dim cPart As Range "This is the part I cannot work out what to
change it to.
Dim cLoc As Range I cannot see anything in the sheet or the
form that
Dim ws As Worksheet refers to cPart"
Set ws = Worksheets("LookupLists") "This I understand along with the rest
that
would make sense when
I work out the first
part - I think"
For Each cPart In ws.Range("PartIDList")
With Me.cboPart
.AddItem cPart.Value
.List(.ListCount - 1, 1) = cPart.Offset(0, 1).Value
End With
Next cPart
For Each cLoc In ws.Range("LocationList")
With Me.cboLocation
.AddItem cLoc.Value
.List(.ListCount - 1, 1) = cLoc.Offset(0, 1).Value
End With
Next cLoc
If anyone could help that would be great.
I have taken this sample code from
http://www.contextures.on.ca/xlUserForm01.html#SetUp (which was a great help)
and downloaded the sample for Enhanced User forms with Combo boxes but I am
stuck on how to modify the first part.
Private Sub UserForm_Initialize()
Dim cPart As Range "This is the part I cannot work out what to
change it to.
Dim cLoc As Range I cannot see anything in the sheet or the
form that
Dim ws As Worksheet refers to cPart"
Set ws = Worksheets("LookupLists") "This I understand along with the rest
that
would make sense when
I work out the first
part - I think"
For Each cPart In ws.Range("PartIDList")
With Me.cboPart
.AddItem cPart.Value
.List(.ListCount - 1, 1) = cPart.Offset(0, 1).Value
End With
Next cPart
For Each cLoc In ws.Range("LocationList")
With Me.cboLocation
.AddItem cLoc.Value
.List(.ListCount - 1, 1) = cLoc.Offset(0, 1).Value
End With
Next cLoc
If anyone could help that would be great.