This runs, but what are you trying to do??
Sub EWO()
'
' EWO Macro
'
'
Sheets("Sheet3").Range("C9:E13").Select
'Index rows and columns as j,i variables.
'M = Columns = X = (E - (C - 1)) = (5 - (3 - 1)) = 3
'N = Rows = Y = (13 - (9 - 1)) = 5
M = 3: N = 5
'For loop around rows and for each in this range assign variables:
For j = 9 To 9 + N
YR = Cells(j, M).Value
CO = Cells(j, M + 1).Value
MO = Cells(j, M + 2).Value
'Select the range where Table 2 is being set up:
Range("H9:L18").Select
'Fill in the vectors above with the information regarding the years (or create a mapping to do the job for you J)
'Select the range where Table 3 is being set up:
Range("H9:L18").Offset(, 6).Select
'Again, index this range to access it based on the value of the previous three variables recently created.
'Fill in the vectors above with the information regarding the years (or create a mapping to do the job for you J)
'Repeat the process based on the loop through the rows in the main data
Next
End Sub
Bookmarks