View Single Post
 
Old 04-03-2018, 01:21 PM
Divinedar Divinedar is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Jun 2016
Posts: 21
Divinedar is on a distinguished road
Default

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.
Reply With Quote