S
Simon
I have a workbook "report". Col A has contains products. The number of
products in column A may vary but each product features only once.
eg:
TOTAL SALES FOR JANUARY
ColA ColB
ItemX 4
ItemY 5
ItemZ 4
Another workbook "sales" contains the individual sales of these items in one
month. So Col A contains the products which may feature once or several
times. Col B contains the Qty.
eg:
SALES FOR JANUARY
ColA ColB
ItemX 1
ItemX 3
ItemY 5
ItemZ 2
ItemZ 2
Both workbooks reside in the same folder.
I want to write vba code which will populate the sum of sales for each
product for the month into Col B of "report".
I think a SumIf might be the way to go except for the following issues:
"Sales" is an external workbook which is not open.
The rows in each workbook can vary depending on the number of products or
the number of sales. "Sales" may contain 5, 10 rows of data or even 100.
"Report" may contain 5, 10 individual products or even 88.
Can anyone suggest code which will pull data from the closed workbook
"Sales" and populate ColB in "Report"
Hope this makes sense. In case you cant tell I'm a beginner.
Cheers
Simon
products in column A may vary but each product features only once.
eg:
TOTAL SALES FOR JANUARY
ColA ColB
ItemX 4
ItemY 5
ItemZ 4
Another workbook "sales" contains the individual sales of these items in one
month. So Col A contains the products which may feature once or several
times. Col B contains the Qty.
eg:
SALES FOR JANUARY
ColA ColB
ItemX 1
ItemX 3
ItemY 5
ItemZ 2
ItemZ 2
Both workbooks reside in the same folder.
I want to write vba code which will populate the sum of sales for each
product for the month into Col B of "report".
I think a SumIf might be the way to go except for the following issues:
"Sales" is an external workbook which is not open.
The rows in each workbook can vary depending on the number of products or
the number of sales. "Sales" may contain 5, 10 rows of data or even 100.
"Report" may contain 5, 10 individual products or even 88.
Can anyone suggest code which will pull data from the closed workbook
"Sales" and populate ColB in "Report"
Hope this makes sense. In case you cant tell I'm a beginner.
Cheers
Simon