In support of this main Forum Thread:
http://www.excelfox.com/forum/showth...1393#post11393
Test file: target1.xlsx
_____ Workbook: target1.xlsx ( Using Excel 2007 32 bit )
Worksheet: Tabelle1
Row\Col A B C D E F G H I J K L M N O P Q 1 2 1 100 1 2 3 2 100 1 2 4
Test file: (Before) target2.xlsx
_____ Workbook: target2.xlsx ( Using Excel 2007 32 bit )
Worksheet: Tabelle1
Row\Col A B C D 1 2 1 1234 3 3 1234 4
Now run macro Sub Vixer() , which should fulfil this logic...
...If column E of target1.xlsx matches with column A of target2.xlsx then look column O of target1.xlsx is greater or column P of target1.xlsx is greater, whichever is greater calculate the 0.50% of that and multiply that with column K of target1.xlsx and paste the result to target2.xlsx from column C(if column C has data then column D and if column D has data then column E and so on...) the result should be in minus means whatever is the result put minus sign in that along with result
The main macro file , macro.xlsm , gets populated thus:
_____ Workbook: macro.xlsm ( Using Excel 2007 32 bit )
Worksheet: Tabelle2
Row\Col A B C D E F G H I J K L M N O P Q 1column A of target2.xlsx column E of target1.xlsx column K of target1.xlsx column O of target1.xlsx column P of target1.xlsx 2 1 1 100 1 2 3 3 2 100 1 2 4
The test file, target2.xlsx , now gets changed to this
Test file results After target2.xlsx
_____ Workbook: target2.xlsx ( Using Excel 2007 32 bit )
Worksheet: Tabelle1
Row\Col A B C D E 1 2 1 1234 -1 3 3 1234 4
macro_ xlsm from Alan.jpg : https://imgur.com/pyf13dA
Attachment 2347)
Bookmarks