G
Guest
Is there a that I can create a list (and add to it) without creating a listbox?
Private Sub CommandOK_Click()
Dim i As Integer
Dim sStr As String
Select Case True
Case CheckMachine.Value
Range("A1").Value = "Marketing"
If CheckMNew.Value = True Then
ListBAdd.AddItem "ProductManager"
ElseIf CheckMFFF.Value = True Then
ListBAdd.AddItem "ProductManager"
ListBAdd.AddItem "Director of Engineering"
ElseIf CheckMWarranty.Value = True Then
ListBAdd.AddItem "Director of Engineering"
ListBAdd.AddItem "Director of Service"
ListBAdd.AddItem "Quality Manager"
ElseIf CheckMDisc.Value = True Then
ListBAdd.AddItem "ProductManager"
End If
End Select
With ListBAdd
For i = 0 To .ListCount - 1
If i <> .ListCount - 1 Then
sStr = sStr & .List(i) & " / "
Else
sStr = sStr & .List(i)
End If
Next i
End With
Range("A4").Value = sStr
End Sub
Private Sub CommandOK_Click()
Dim i As Integer
Dim sStr As String
Select Case True
Case CheckMachine.Value
Range("A1").Value = "Marketing"
If CheckMNew.Value = True Then
ListBAdd.AddItem "ProductManager"
ElseIf CheckMFFF.Value = True Then
ListBAdd.AddItem "ProductManager"
ListBAdd.AddItem "Director of Engineering"
ElseIf CheckMWarranty.Value = True Then
ListBAdd.AddItem "Director of Engineering"
ListBAdd.AddItem "Director of Service"
ListBAdd.AddItem "Quality Manager"
ElseIf CheckMDisc.Value = True Then
ListBAdd.AddItem "ProductManager"
End If
End Select
With ListBAdd
For i = 0 To .ListCount - 1
If i <> .ListCount - 1 Then
sStr = sStr & .List(i) & " / "
Else
sStr = sStr & .List(i)
End If
Next i
End With
Range("A4").Value = sStr
End Sub