Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Run = Range(Cells(1, 59), Cells(Lastrow, 59))
ProjectID = Range(Cells(1, 6), Cells(Lastrow, 6))
TaskID = Range(Cells(1, 1), Cells(Lastrow, 1))
StartDate = Range(Cells(1, 36), Cells(Lastrow, 36))
EndDate = Range(Cells(1, 37), Cells(Lastrow, 37))
Sub timertest2()
Dim StartTime As Double
Dim Elapsed As Double
For i = 1 To 10
For j = 1 To 6
Cells(i, j) = 0
Next j
Next i
StartTime = Timer
For i = 1 To 10
For j = 1 To 6
Cells(i, j) = Cells(i, j) + 1
Next j
Next i
Elapsed = (Timer - StartTime)
MsgBox ("looping thru cells =" & Elapsed)
StartTime = Timer
inarr = Range(Cells(1, 1), Cells(10, 6))
For i = 1 To 10
For j = 1 To 6
inarr(i, j) = inarr(i, j) + 1
Next j
Next i
Range(Cells(1, 1), Cells(10, 6)) = inarr
Elapsed = (Timer - StartTime)
MsgBox ("looping thru cells =" & Elapsed)
End Sub
As you have noticed I don't declare variables unless absolutely necessary. Declaring inarr as variant is totally unnecessary because the next line where it is loaded from the range in the worksheet means it must be a variant array, and the range determines the dimensions. So to my thinking the declaration line is a waste of space.
Set type = Range("type")
Set table= Range("table")
Set Source= Range("Source")
Set headers= Range("headers")
i = 2
j = 2
lMaxRow = ThisWorkbook.Sheets("TEST").Cells(Rows.Count, 1).End(xlUp).Row - 23
lMaxCol = ThisWorkbook.Sheets("translation").Cells(2, Columns.Count).End(xlToLeft).Column
Do While i < lMaxRow
a = ThisWorkbook.Sheets("TEST").Cells(i + 24, 12).Value
ThisWorkbook.Sheets("output").Cells(i, 1).Value = a
Do While j < 180
b = Application.Index(source, i, Application.Match(Application.Index(table, Application.Match(a, type, 0), j), header, 0))
ThisWorkbook.Sheets("output").Cells(i, j).Value = b
j = j + 1
Loop
j = 2
i = i + 1
Loop
End Sub