Hello,
I've written the code below to the best of my ability, but I would like some changes doing and don't know how to do them.
Please help!
The code currently searches for "01", but I would really like it to search for non blanks within column A from cell A2.
It also only runs to row 100, but I would like it to run until the seach ends.
Any ideas?
Thanks
Andrew
Columns("a:a"
.Select
Dim R As Long
For R = 2 To 100
Cells.Find(What:="01", After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlDown, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(-1, 16).Select
ActiveCell.FormulaR1C1 = "=SUM(R[1]C:R[" & _
ActiveCell.Offset(1, 0).Range("A1"
.End(xlDown).Row _
- ActiveCell.Row & "]C)"
Selection.Copy
ActiveCell.Offset(1, -8).Value = ActiveCell.Value
ActiveCell.Value = ""
ActiveCell.Offset(2, -16).Select
Next R
End Sub
I've written the code below to the best of my ability, but I would like some changes doing and don't know how to do them.
Please help!
The code currently searches for "01", but I would really like it to search for non blanks within column A from cell A2.
It also only runs to row 100, but I would like it to run until the seach ends.
Any ideas?
Thanks
Andrew
Columns("a:a"
Dim R As Long
For R = 2 To 100
Cells.Find(What:="01", After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlDown, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(-1, 16).Select
ActiveCell.FormulaR1C1 = "=SUM(R[1]C:R[" & _
ActiveCell.Offset(1, 0).Range("A1"
- ActiveCell.Row & "]C)"
Selection.Copy
ActiveCell.Offset(1, -8).Value = ActiveCell.Value
ActiveCell.Value = ""
ActiveCell.Offset(2, -16).Select
Next R
End Sub