copy down values in adjacent coumn

  • Thread starter Thread starter SoozeeC
  • Start date Start date
S

SoozeeC

I have data in column B, the number of active cells in which is variable. I
want to perform a calculation in C2 relating to B2 and then copy it down
column C as far as the last active cell in column B.

Any ideas?
 
range( range("C3) , Range("B2").End(xldown).offset(,1) ).FormulaR1C1 = _
Range("C2").FormulaR1C1
 
Try the below..

Sub Macro()

Dim lngRow As Long
'Returns the last filled row in colB
lngRow = Cells(Rows.Count, "B").End(xlUp).Row

Range("C2:C" & lngRow).Formula = "=sum(a2:b2)"

End Sub

If this post helps click Yes
 
Usually I put the formula in C2 and then copy down the column

Range("C2").formula = "=B2+1"
LastRow = Range("B" & Rows.count).end(xlup).row
Range("C2").copy _
Destination:=Range("C2:C" & LastRow)
 
I also assumed that the formula was in C3.

Joel said:
Usually I put the formula in C2 and then copy down the column

Range("C2").formula = "=B2+1"
LastRow = Range("B" & Rows.count).end(xlup).row
Range("C2").copy _
Destination:=Range("C2:C" & LastRow)
 
Back
Top