If condition

RSEKAR

Board Regular
Joined
Oct 18, 2010
Messages
172
Dear Sir,

I use Excel 2002
I am unable to use IF condition to run a macro between two books
If the numerical data between the particular cells of the two books is not equal then the macro should run.
I have 2 excel books TUMA.XLS AND SEKAR.XLS
In both books I have a sheet by name “ALL”
I want to create a condition as in both the cells (AR10) of both the “ALL” sheets if found not equal the macro should run.
If the cells are equal the macro should not run.
I have tried the following line in the beginning of the macro.
I get error message on completing the line.
Kindly advice how to give the IF condition to start the macro.
IF [TUMA.xls] (ALL!$AR$10) <> [SEKAR.xls]ALL!$AR$10) Then
Call (macro name)
Macro is present in the TUMA.XLS book.
Thanking you Sir,
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Maybe

Code:
If Workbooks("TUMA.xls").Sheets("ALL").Range("AR10").Value <> Workbooks("SEKAR.xls").Sheets("AL").Range("AR10").Value Then
 
Upvote 0
Dear Sir,
How to add OR with the above statement.
If
AR10<>AR10 OR
AR11<>AR11 OR
AR12<>AR12 Then
Call Macro
(if any one or more conditions become true the macro should start).

Thanking you,
 
Upvote 0
Dear Sir,
I got the answer to use OR with the above statements.
Thanking you for your statement above which I further built up.
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,348
Members
452,907
Latest member
Roland Deschain

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top