Hi,
I am trying to write some vba code which will allow me to look to see the value of a cell, if that cell = X then display a msgbox "cell = X, are you Sure?" with options yes or no. If they click no then it exits the sub routine. If they click yes then the code continues onto the next line.
i am quite sure i being stupid but just cant figure it out.
so far i have the below but it doesnt like it for some reason and just crashes my excel when i run it...
I am trying to write some vba code which will allow me to look to see the value of a cell, if that cell = X then display a msgbox "cell = X, are you Sure?" with options yes or no. If they click no then it exits the sub routine. If they click yes then the code continues onto the next line.
i am quite sure i being stupid but just cant figure it out.
so far i have the below but it doesnt like it for some reason and just crashes my excel when i run it...
Code:
If Sheets("Data 2").Range("I7") <> "N" Then
If MsgBox("This line has already been submitted with the below details..." & vbNewLine & vbNewLine & ("Do you want to override the data?") & vbNewLine & vbNewLine & Range("H8") & Dup_Added_By & vbNewLine & Range("H9") & Dup_Block_Type & vbNewLine & Range("H10") & Dup_Apply_Date & vbNewLine & Range("H11") & Dup_End_Date, vbYesNo + vbQuestion) = vbNo Then Exit Sub
Else
End If