Ok so in a workbook I have other worksheets. I'm trying consolidate them into one worksheet. When reading the code I need to do as follows:
For j = 3 To 14 'The row of dates. Starts at C1 to N1
If sht.Cells(1, j) = pMonth Then 'This says ROW 1,COLUMNS C THRU N
For i = 2 To 30 'This says ROWS 2 THRU 30
If sht.Cells(i, 2) = strField Then ' This is ROWS 2 THRU 30, COLUMN B
Refers to each worksheet (5 years (1 year each worksheet) within the workbook. I can't use consolidation because they are not exactly the same. The list is different on each worksheet in column 2 and the years are different on each worksheet (1 year on each worksheet for up to 5 years) so 5 worksheets to consolidate. So I have a sheet that I consolidated all the countries (column 2 of worksheets) into one worksheet.
What I need the code to do is to collect each year total for each country from each worksheet into one worksheet.
I hope you understand.
|