add & subtract data as per condition

hdgfss

New Member
Joined
Aug 29, 2019
Messages
41
Hi Experts,
I am looking for a macro that will do the things mentioned below

there are 3 files 1.xls & BasketOrder.xlsx & macro.xlsm (macro will be placed in macro.xlsm),both files are loacted in diffrent places so the path will be hardcoded in the macro so that i can change it as per my needs
sheet name can be anything
plz see the sample file


If column C of basketorder.xlsx matches with column B of 1.xls & Column J is BUY then add 0.05 to column D of 1.xls & compare column L of basketorder.xlsx with column D of of 1.xls & if column D of 1.xls is lower then Column L of basketorder.xlsx then replace column L data with column D data OF 1.xls

If column C of basketorder.xlsx matches with column B of 1.xls & Column J is SELL then subtract 0.05 to column D of 1.xls & compare column L of basketorder.xlsx with column D of of 1.xls & if column D of 1.xls is greater then Column L of basketorder.xlsx then replace column L data with column D data OF 1.xls




Also posted here calculation & paste by vba
 
Last edited by a moderator:

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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