I have a combobox on a userform that is populated according to the code below
The user then makes adjusments to certain entries - the code is then re-run to produce a new list with the corrected entry removed. To do this I use the following:
AnalCodesUserForm.JobNumberComboBox.Clear
When the code re-runs though, the code breaks and I get the unspecified error message and it highlights the above line?
Case "None"
x = -1
For z = 1 To JobCount
If Application.WorksheetFunction.VLookup(JobArray(z, 1), JobSource, 16, False) = "None" _
Or Application.WorksheetFunction.VLookup(JobArray(z, 1), JobSource, 16, False) = "Part" Then
x = x + 1
AnalCodesUF.JobNumberCB.AddItem JobArray(z, 1)
AnalCodesUF.JobNumberCB.List(x, 1) = JobArray(z, 2)
Else
End If
Next
End Select
Has anyone seen something like this before? I couldn't find much about combobox.clear questions.
The user then makes adjusments to certain entries - the code is then re-run to produce a new list with the corrected entry removed. To do this I use the following:
AnalCodesUserForm.JobNumberComboBox.Clear
When the code re-runs though, the code breaks and I get the unspecified error message and it highlights the above line?
Case "None"
x = -1
For z = 1 To JobCount
If Application.WorksheetFunction.VLookup(JobArray(z, 1), JobSource, 16, False) = "None" _
Or Application.WorksheetFunction.VLookup(JobArray(z, 1), JobSource, 16, False) = "Part" Then
x = x + 1
AnalCodesUF.JobNumberCB.AddItem JobArray(z, 1)
AnalCodesUF.JobNumberCB.List(x, 1) = JobArray(z, 2)
Else
End If
Next
End Select
Has anyone seen something like this before? I couldn't find much about combobox.clear questions.