Hi there,
I am trying to understand how the Replace() part works. Operationally, it is a dynamic dropdown list based on combo boxes on a user form.
Private Sub ComboBox1_Change()
Dim strRange As String
If ComboBox1.ListIndex > -1 Then
strRange = ComboBox1
Label2.Caption = strRange
strRange = Replace(strRange, " ", "_")
With ComboBox2
.RowSource = vbNullString
.RowSource = strRange
.ListIndex = 0
End With
Else
Label2.Caption = "Associated Items"
End If
End Sub
How does the replace() part work? and what does the .listindex > -1 represent?
thanks
Bookmarks