Looking to do something like this on a Command Button
If Range("N9").Value = Range("E8").Value Then
'Run another if statement code here'
If Range("N9") = "" Or Range("O9") = "" Or Range("P9") = "" Then
'Do Nothing'
'If Cut Section, Length, And Width Is NOT Empty, Message Box Error'
ElseIf Range("P8") > Range("G8") Or Range("O8") > Range("F8") Then
MsgBox "Your Cut Dimensions Do No Fit Inside The Section You Specified"
If Range("N9").Value = Range("E9").Value Then
'Run another if statement code here'
If Range("N9") = "" Or Range("O9") = "" Or Range("P9") = "" Then
'Do Nothing'
'If Cut Section, Length, And Width Is NOT Empty, Message Box Error'
ElseIf Range("P8") > Range("G8") Or Range("O8") > Range("F8") Then
MsgBox "Your Cut Dimensions Do No Fit Inside The Section You Specified"
Basically... I want to run an "IF" after an "IF" "Depending on what the value is...
hmm.. Try to word it the best I can.. haha..
If the value of my N9 = the value of E8, I want to run my if statements to follow.
If the value of my N9 = the value of E9, I'd like to run a different set of if statements to follow.
I want to click the button and have it check which value N9 ='s. Then It needs to run more if statements depending on the conditions I have. I thought I could do it with directives like this..
But I'm having some issues.. Any help?
I'm still googling the hell out of this.. Could I use something like
If [Condition] Then
If [Condition] Then
[Condition]
Exit sub?
If Range("N9").Value = Range("E8").Value Then
'Run another if statement code here'
If Range("N9") = "" Or Range("O9") = "" Or Range("P9") = "" Then
'Do Nothing'
'If Cut Section, Length, And Width Is NOT Empty, Message Box Error'
ElseIf Range("P8") > Range("G8") Or Range("O8") > Range("F8") Then
MsgBox "Your Cut Dimensions Do No Fit Inside The Section You Specified"
If Range("N9").Value = Range("E9").Value Then
'Run another if statement code here'
If Range("N9") = "" Or Range("O9") = "" Or Range("P9") = "" Then
'Do Nothing'
'If Cut Section, Length, And Width Is NOT Empty, Message Box Error'
ElseIf Range("P8") > Range("G8") Or Range("O8") > Range("F8") Then
MsgBox "Your Cut Dimensions Do No Fit Inside The Section You Specified"
Basically... I want to run an "IF" after an "IF" "Depending on what the value is...
hmm.. Try to word it the best I can.. haha..
If the value of my N9 = the value of E8, I want to run my if statements to follow.
If the value of my N9 = the value of E9, I'd like to run a different set of if statements to follow.
I want to click the button and have it check which value N9 ='s. Then It needs to run more if statements depending on the conditions I have. I thought I could do it with directives like this..
Code:
[COLOR=#007D9A][FONT=Consolas]#Const CustomerNumber = 36[/FONT][/COLOR][COLOR=#007D9A][FONT=Consolas]#If CustomerNumber = 35 Then[/FONT][/COLOR][COLOR=green][FONT=Consolas]' Insert code to be compiled for customer # 35.[/FONT][/COLOR][COLOR=#007D9A][FONT=Consolas]#ElseIf CustomerNumber = 36 Then[/FONT][/COLOR][COLOR=green][FONT=Consolas]' Insert code to be compiled for customer # 36.[/FONT][/COLOR][COLOR=#007D9A][FONT=Consolas]#Else[/FONT][/COLOR][COLOR=green][FONT=Consolas]' Insert code to be compiled for all other customers.[/FONT][/COLOR][COLOR=#007D9A][FONT=Consolas]#End If
[/FONT][/COLOR]
I'm still googling the hell out of this.. Could I use something like
If [Condition] Then
If [Condition] Then
[Condition]
Exit sub?
Last edited: