billandrew
Well-known Member
- Joined
- Mar 9, 2014
- Messages
- 743
Good afternoon
What are the advantages of utilizing the With Statement. Additional question How would an array be beneficial here?
Thank You
With -
lr = Range("B" & Rows.Count).End(xlUp).Row
For i = 2 To lr
With Sheet2
.Cells(i, "D").Value = Application.WorksheetFunction.Sum(.Range(Cells(i, "B"), Cells(i, "C")))
.Cells(i, "E").Value = Application.WorksheetFunction.Average(.Range(Cells(i, "B"), Cells(i, "C")))
End With
Next I
What are the advantages of utilizing the With Statement. Additional question How would an array be beneficial here?
Thank You
With -
lr = Range("B" & Rows.Count).End(xlUp).Row
For i = 2 To lr
With Sheet2
.Cells(i, "D").Value = Application.WorksheetFunction.Sum(.Range(Cells(i, "B"), Cells(i, "C")))
.Cells(i, "E").Value = Application.WorksheetFunction.Average(.Range(Cells(i, "B"), Cells(i, "C")))
End With
Next I