I have a userform and I' using this code to fill A textbox (txt_record) with an ID # for that record. As of now it only gives the number of that entry (such as 00146).
I have another box (combo_intake_type) that lists the different types of intakes that the user can choose from. This list is expandable from a list accessed by the user.
I wish for that ID # to show the first two letters of the Intake type (combo_intake_type) that has been chosen. Such as if the user chooses 'Geometry' as the next entry the ID # would be 00147-GE , If 'Mechanical' is chosen next the ID # would be 00148-ME
VBA Code:
Private Sub UserForm_Activate()
Dim sh As Worksheet
Set sh = ShDA01
Dim lr As Long
Dim x As Long
x = ShDA01.Range("C" & Rows.Count).End(xlUp).Row
lr = ShDA01.Range("C" & Rows.Count).End(xlUp).Row
With Txt_Record
.Value = Format(Val(Range("C" & Rows.Count).End(xlUp)) + 1, "00000")
.Enabled = True
End With
End Sub
I have another box (combo_intake_type) that lists the different types of intakes that the user can choose from. This list is expandable from a list accessed by the user.
I wish for that ID # to show the first two letters of the Intake type (combo_intake_type) that has been chosen. Such as if the user chooses 'Geometry' as the next entry the ID # would be 00147-GE , If 'Mechanical' is chosen next the ID # would be 00148-ME