I have a part number string that needs to be dynamic enough to handle null values for certain components. This takes the form UC625-16-[highlight #FCE94F]4UN[/highlight]-GN-HH-R-048-M3-T where if 4UN is a null value it's removed from the string. Similarly M3 & T can be removed in the same manner. What I'm struggling with the logic that encompasses all three. The PN structure also need to be maintained. The code I have tried is:-
Any help or guidance is appreciated
Sheets("Data Entry").Select 'Take all information from this sheet
Dim unit_Type As String
Dim Input_count As Integer
Dim Un_armed As String
Dim LED As String
Dim Pri_PSU As String
Dim Aux_PSU As String
Dim Repeat As String
Dim FCV As String
Dim M_Option As String
Dim Trop As String
unit_Type = [D11].Value
Input_count = [D12].Value
Un_armed = [D13].Value
LED = [D14].Value
Pri_PSU = [D15].Value
Aux_PSU = [D16].Value
Repeat = [D17].Value
FCV = [D18].Value
M_Option = [D19].Value
Trop = [D20].Value
Select Case Un_armed
Case Is = " ":
If M_Option = " " Then
[N3].Value = "One"
ElseIf M_Option = "M3" Then
[N3].Value = "Two"
ElseIf Trop = "T" Then
[N3].Value = "Three"
End If
[H10].Value = unit_Type & "-" & Input_count & "-" & LED & "-" & Pri_PSU & Aux_PSU
If M_Option = "M3" Then
[N3].Value = "Boo"
End If
Case Is <> " ": [H10].Value = unit_Type & "-" & Input_count & "-" & Un_armed & "-" & LED & "-" & Pri_PSU & Aux_PSU & "-" & Repeat & "-" _
& FCV & "-" & M_Option & "-" & Trop
Any help or guidance is appreciated
Sheets("Data Entry").Select 'Take all information from this sheet
Dim unit_Type As String
Dim Input_count As Integer
Dim Un_armed As String
Dim LED As String
Dim Pri_PSU As String
Dim Aux_PSU As String
Dim Repeat As String
Dim FCV As String
Dim M_Option As String
Dim Trop As String
unit_Type = [D11].Value
Input_count = [D12].Value
Un_armed = [D13].Value
LED = [D14].Value
Pri_PSU = [D15].Value
Aux_PSU = [D16].Value
Repeat = [D17].Value
FCV = [D18].Value
M_Option = [D19].Value
Trop = [D20].Value
Select Case Un_armed
Case Is = " ":
If M_Option = " " Then
[N3].Value = "One"
ElseIf M_Option = "M3" Then
[N3].Value = "Two"
ElseIf Trop = "T" Then
[N3].Value = "Three"
End If
[H10].Value = unit_Type & "-" & Input_count & "-" & LED & "-" & Pri_PSU & Aux_PSU
If M_Option = "M3" Then
[N3].Value = "Boo"
End If
Case Is <> " ": [H10].Value = unit_Type & "-" & Input_count & "-" & Un_armed & "-" & LED & "-" & Pri_PSU & Aux_PSU & "-" & Repeat & "-" _
& FCV & "-" & M_Option & "-" & Trop