Lobsterboy1
Board Regular
- Joined
- Aug 5, 2016
- Messages
- 90
Hi, I am pretty new to vba but I have picked up a lot from this forum. I am trying to write a code that finds the blank cells in a column "Q" and inserts the sum function for the cells above it and the same rows but one column to the right "R" . It will then work down the sheet continuing until the end of the filled cells which change daily. The problem is the cells in "Q" contain a formula which so in Q4 the formula would be =IF(P4="NO",E4,""). I have found and adapted some code that works on another column "E" but these cells just contain numbers which is
Code:
Sub Macro20()Dim aArea As Range
For Each aArea In Columns("E").SpecialCells(xlCellTypeConstants).Areas
Cells(aArea.Row + aArea.Rows.Count, 5).Value = WorksheetFunction.Sum(Range(Cells(aArea.Row, 5), Cells(aArea.Row + aArea.Rows.Count - 1, 5)))
Next aArea
End Sub
[code/]
Any help would be much appricated :).