PDA

View Full Version : compare names, substract values from one workbook to another



niklasbp
01-30-2015, 10:31 AM
Hi There

I cant figure out how to write this macro, i have one workbook i update everyday, it looks like this named "mislykkede":



Emner
Soho
Winback
Pristjek


Salgssum
Soho
Winback
Pristjek


Anders
1
5
9



200
1000
1500


Sælger 1

2





400



Sælger 1
20
4
1





550



And another workbook called "Statistik" which has alot of columns

i want to compare the name in range A starting with A2 to last in Workbook "Mislykkede" sheetname = "mislykkedes", with workbook "Statistik" sheetname ="Phonereffektivitet" sheet Range A2 to last
when there is a match then compare the first row name SOHO cell(B1) in workbook "mislykkede" and find the first match in workbook "Statistik" column A, where column P is above 0
then workbook "mislykkede" substract cell (row, B) from both column I and P in workbook "Statistik"
and substract workbook "mislykkedes" cell (row, H) from column Q in workbook "statistik"

so that whenever the same name is in the two workbooks it will substract the Soho numbers from the SOHO ROW in "Statistik"

and loop this with Winback (C2) and Pristjek (D2) - not case sensitive

is this even possible =) ?

/the vba newb