Forum

Notifications
Clear all

Copy & Paste if condition met with add & subtract

6 Posts
3 Users
0 Reactions
63 Views
(@leonardo1234)
Posts: 26
Eminent Member
Topic starter
 

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

Thnx for the Help

 
Posted : 27/07/2020 3:38 am
(@purfleet)
Posts: 412
Reputable Member
 

Hi Sholtan
This question seems very similar to the last few that you have posted. Have you attempted to come up with a formula that can do what you have asked?

Rather than trying to decipher all the permutations of what want, I think it would make sense for you create an if/and formula that could be added to the vba

Your requirements seem very specific so I am assuming that you are doing something similar manually at the moment?

Purfleet

 
Posted : 27/07/2020 4:38 pm
(@leonardo1234)
Posts: 26
Eminent Member
Topic starter
 

I tried but I don't know how to solve this problem so I asked the question & I have never putted the formula in a macro so I don't know how to solve this problem

If I get the macro for the same so I can learn from it ,

 
Posted : 28/07/2020 1:12 am
(@leonardo1234)
Posts: 26
Eminent Member
Topic starter
 

Problem Solved

 
Posted : 31/07/2020 3:55 am
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi Sholtan,

I believe your are cross posting these questions.

Please read the terms for using this forum as you are in breach

https://www.myonlinetraininghub.com/excel-forum/forum-rules-and-guides/read-this-first

If you continue to cross post without linking to these posts, your account will be suspended.

Phil

 
Posted : 31/07/2020 4:52 am
(@leonardo1234)
Posts: 26
Eminent Member
Topic starter
 

Sure Sir, I will do it

From next time

 
Posted : 31/07/2020 6:50 am
Share: