View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] transferxxx@gmail.com is offline
external usenet poster
 
Posts: 31
Default Loop to determine number of rows range

Can anybody tell me why macro is not looping to last cell in row of
column c - pls correct my macro. Thxs

Sub Loop()

Dim i As Integer
For i = 1 To Range("A1").CurrentRegion.Rows.Count - 1
Range("C2").FormulaR1C1 = "=Average(RC[-1],RC[-2])"
Range("C2").Offset(1, 0).Select
Next i
End Sub