Hi gurus,

I've written the below code to sum all payments on row 2 in the next blank column of worksheet w2 (see below).

How can I have the below formula loop down the column until there is a blank cell in the column to the left i.e. Offset(0,-1)? I am trying to avoid using select and activecell etc.

Thanks in advance! Any help is much appreciated

Dim rLastCell As Range

Set rLastCell = w2.Cells.Find(What:="*", After:=w2.Cells(1, 1), LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlPrevious, MatchCase:=False)

rLastColumn = rLastCell.Column + 1

w2.Cells(2, rLastColumn).FormulaR1C1 = "=SUM(RC40:RC[-1])"