The full code:
' standard module: mRainfall
Sub Rainfall()
' determine last row of data
Dim lLR As Long
lLR = Range("A" & Rows.Count).End(xlUp).Row
Application.ScreenUpdating = False
' =COUNTIF(B2:B366,0)
With Range("D2:D" & lLR)
.FormulaR1C1 = _
"=COUNTIF(RC[-2]:R[364]C[-2],0)"
.Value = .Value
End With
' =365-COUNTIF(B2:B366,0)
With Range("E2:E" & lLR)
.FormulaR1C1 = _
"=365-COUNTIF(RC[-3]:R[364]C[-3],0)"
.Value = .Value
End With
' =D2+E2
With Range("F2:F" & lLR)
.FormulaR1C1 = _
"=RC[-2]+RC[-1]"
.Value = .Value
End With
Application.ScreenUpdating = True
End Sub
Is this a new question? If it is, you should start a new thread. Either way, you'll need to provide a lot more information.
Regards, TMS
Bookmarks