Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Loop()
Dim i As Integer i = Range("A1").CurrentRegion.Rows.Count Range("C2").Resize(i).FormulaR1C1 = "=Average(RC[-1],RC[-2])" End Sub -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) wrote in message s.com... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I determine which data in a range add up to a fixed number? | Excel Worksheet Functions | |||
sumproduct, multiple if, some same cell, determine number of rows | Excel Worksheet Functions | |||
Insert Variable Number of Rows; With Loop | Excel Worksheet Functions | |||
Determine number of rows meeting a condition | Excel Discussion (Misc queries) | |||
Formula to determine whether number falls within range?? | Excel Worksheet Functions |