ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA Macro (https://www.excelbanter.com/excel-programming/340018-vba-macro.html)

Erik K via OfficeKB.com

VBA Macro
 
I have created a VBA Macro and need it to run only if 2 different cells equal
a certain criteria. Example
If L4=Monday and M10=12 then run Macro. What is my syntax in VBA?

Shatin[_2_]

VBA Macro
 
Say the name of the macro is Macro1:

If range("L4") = "Monday" AND range("M10") = 12 then Macro1

"Erik K via OfficeKB.com" wrote in message
...
I have created a VBA Macro and need it to run only if 2 different cells

equal
a certain criteria. Example
If L4=Monday and M10=12 then run Macro. What is my syntax in VBA?




Bob Phillips[_6_]

VBA Macro
 
If Range("L4").Value = "Monday" And Range("M10").Value = 12 Then
Macro1
End If

--
HTH

Bob Phillips

"Erik K via OfficeKB.com" wrote in message
...
I have created a VBA Macro and need it to run only if 2 different cells

equal
a certain criteria. Example
If L4=Monday and M10=12 then run Macro. What is my syntax in VBA?




Erik K via OfficeKB.com

VBA Macro
 
Thanks! It worked perfectly!

Bob Phillips wrote:
If Range("L4").Value = "Monday" And Range("M10").Value = 12 Then
Macro1
End If

I have created a VBA Macro and need it to run only if 2 different cells equal
a certain criteria. Example
If L4=Monday and M10=12 then run Macro. What is my syntax in VBA?



--
Message posted via http://www.officekb.com


All times are GMT +1. The time now is 11:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com