Hello first time poster. I have exceeded the nest limit for an IF function and I was wondering if someone could help me come up with a solution. I don't mind creating another sheet and then using the VLookup or if there is something better. I am trying to do this in VBA and the only input would be a button press and then entering in the associated number.
PHP:
Dim myvalue As Variant
Dim Qty As Variant
Dim SBP_Ground_Wire_Weight As String
Dim SBP_Lead_Wire_Weight As String
Dim SBP_OD_Preform_Weight As String
Dim SBP_ID_Preform_Weight As String
Dim SBP_9CH_Ground_Wire_Weight As String
Dim SBP_9CH_Lead_Wire_Weight As String
Dim SBP_9CH_OD_Preform_Weight As String
Dim SBP_9CH_ID_Preform_Weight As String
Dim DD_4CH_Lead_Wire_Weight As String
Dim DD_4CH_OD_Preform_Weight As String
Dim DD_4CH_ID_Preform_Weight As String
Dim DD_6CH_Ground_Wire_Weight As String
Dim DD_6CH_Lead_Wire_Weight As String
Dim DD_6CH_OD_Preform_Weight As String
Dim DD_6CH_ID_Preform_Weight As String
'Prompt for Material Number
myvalue = InputBox("Material Number?")
If myvalue = 100154016 Then GoTo SBP_Ground_Wire
ElseIf myvalue = 1001 Then GoTo SBP_Lead_Wire
ElseIf myvalue = 1002 Or 10002 Then GoTo SBP_OD_Preform
ElseIf myvalue = 1003 Or 10003 Then GoTo SBP_ID_Preform
If myvalue = 8284 Then GoTo SBP_9CH_Ground_Wire
ElseIf myvalue = 8285 Then GoTo SBP_9CH_Lead_Wire
ElseIf myvalue = 7905 Or 7902 Then GoTo SBP_9CH_OD_Preform
ElseIf myvalue = 4019 Or 4012 Then GoTo SBP_9CH_ID_Preform
If myvalue = 6305 Then GoTo DD_4CH_Lead_Wire
ElseIf myvalue = 6325 Or 6306 Then GoTo DD_4CH_OD_Preform
ElseIf myvalue = 2103 Or 2104 Then GoTo DD_4CH_ID_Preform
If myvalue = 2109 Then GoTo DD_6CH_Ground_Wire
ElseIf myvalue = 2108 Then GoTo DD_6CH_Lead_Wire
ElseIf myvalue = 2105 Or 2106 Then GoTo
DD_6CH_OD_Preform
ElseIf myvalue = 2104 Or 2103 Then GoTo DD_6CH_ID_Preform
Else MsgBox "Material Number not Recognized" ActiveSheet.Protect Password:="-----"
Exit Sub
End If