If multiple conditions are met then macro else do nothing
cs13
-
f894009 Posted messages 17417 Registration date Status Member Last intervention -
f894009 Posted messages 17417 Registration date Status Member Last intervention -
Hello,
I would like to perform or not perform an action based on conditions being met or not.
That is to say:
if the last line of column C on Sheet2 is "moteur" and the value of C2 on my Sheet1 is > 0, then the result of C2 on Sheet1 = C2 - 1, otherwise do not execute the macros and display a message box "stock at zero".
I’m missing some things... The know-how, perhaps :-)
If Sheets("Sheet2").Range("C65536").End(xlUp) = "moteur" and Sheets("Sheet1").Range("C2") > 0 Then Sheets("Sheet1").Range("C2") = Sheets("Sheet1").Range("C2") - 1 Else (do not execute the macro and display message box = "stock at zero"
Thank you very much for your help.
I would like to perform or not perform an action based on conditions being met or not.
That is to say:
if the last line of column C on Sheet2 is "moteur" and the value of C2 on my Sheet1 is > 0, then the result of C2 on Sheet1 = C2 - 1, otherwise do not execute the macros and display a message box "stock at zero".
I’m missing some things... The know-how, perhaps :-)
If Sheets("Sheet2").Range("C65536").End(xlUp) = "moteur" and Sheets("Sheet1").Range("C2") > 0 Then Sheets("Sheet1").Range("C2") = Sheets("Sheet1").Range("C2") - 1 Else (do not execute the macro and display message box = "stock at zero"
Thank you very much for your help.