Hi All,
The code below is causing incorrect data to be extracted. Can anyone help to solve, please.
Option Explicit
Private Sub ComboBox4_Change()
With Me.ComboBox4
If .ListIndex > -1 Then
Me.Cells(11, "G") = .Value
Me.Cells(11, "H") = Val(.List(.ListIndex, 1))
End If
End With
End Sub
My combo box range is U26:V150.
My input cells are G and H.
G contains a two letter alpha entry.
H contains 1 or 2 digits.
In my database U26:V150 is:-
RA 4
RA 6
RP 4
RP 5
Problem:
When I choose say RA 6 from the dropdown box, the number in H reverts back to 4.
If I choose say RP 5 the number also reverts back to 4.
The alpha code is always inserted correctly but the number goes to the first number entry which is 4.
It looks like it gets confused by duplicates. When I don’t have duplicates it behaves normally and correctly. Could anyone suggest a solution to fix this annoying problem.
Thanks
RC
The code below is causing incorrect data to be extracted. Can anyone help to solve, please.
Option Explicit
Private Sub ComboBox4_Change()
With Me.ComboBox4
If .ListIndex > -1 Then
Me.Cells(11, "G") = .Value
Me.Cells(11, "H") = Val(.List(.ListIndex, 1))
End If
End With
End Sub
My combo box range is U26:V150.
My input cells are G and H.
G contains a two letter alpha entry.
H contains 1 or 2 digits.
In my database U26:V150 is:-
RA 4
RA 6
RP 4
RP 5
Problem:
When I choose say RA 6 from the dropdown box, the number in H reverts back to 4.
If I choose say RP 5 the number also reverts back to 4.
The alpha code is always inserted correctly but the number goes to the first number entry which is 4.
It looks like it gets confused by duplicates. When I don’t have duplicates it behaves normally and correctly. Could anyone suggest a solution to fix this annoying problem.
Thanks
RC