Thanks for the reply but the last thread code did not work for me.
Maybe I should attach all code. I am skipping the header code as I
know it works and showing the last header in row 1, column Y as the 1st
line. This calculates the columns P2 - Y2 in row 2 only. I had about
13,000 rows in the last example and you could tell it was going through
the iterations but not filling in the data. It took a while and finally
stopped so I could tell it was looping through the columns; however, the
columns Px - Yx were not filled out.
Must be something simple.
ActiveCell.FormulaR1C1 = "Daily Wtr"
Range("P2").Select
'
' Start of row calculations.
'
Dim rng As Range, i As Long
i = 1
Set rng = Cells(i, 1)
Do While Application.CountA(rng.Resize(1, 15)) <> 0
'
' Calculate columns P - Y.
'
Cells(ActiveCell.Row, "P").FormulaR1C1 = "=IF(RC[-7]=0,""
"",(RC[-6]*1000)/RC[-7])"
Cells(ActiveCell.Row, "Q").FormulaR1C1 = _
"=IF((RC[-8]+RC[-6])=0,"" "",(RC[-7]*1000)/(RC[-8]+RC[-6]))"
Cells(ActiveCell.Row, "R").FormulaR1C1 = "=IF(RC[-9]=0,""
"",RC[-7]/RC[-9])"
Cells(ActiveCell.Row, "S").FormulaR1C1 = _
"=IF((RC[-10]+RC[-8])=0,"" "",RC[-8]/(RC[-10]+RC[-8]))"
Cells(ActiveCell.Row, "T").FormulaR1C1 = "=IF(RC[-11]=0,""
"",RC[-10]/RC[-11])"
Cells(ActiveCell.Row, "U").FormulaR1C1 = "=IF(RC[-11]=0,""
"",RC[-12]/RC[-11])"
Cells(ActiveCell.Row, "V").FormulaR1C1 = "=IF(RC[-12]=0,""
"",RC[-11]/RC[-12])"
Cells(ActiveCell.Row, "W").FormulaR1C1 = "=SUM(RC[-14]/30)"
Cells(ActiveCell.Row, "X").FormulaR1C1 = "=SUM(RC[-14]/30)"
Cells(ActiveCell.Row, "Y").FormulaR1C1 = "=SUM(RC[-14]/30)"
'
' Next row.
'
i = i + 1
Set rng = rng.Offset(1, 0)
Loop
'
' Format columns P - Y.
'
Columns("P:R").Select
Selection.NumberFormat = "#,##0"
Columns("S:S").Select
Selection.NumberFormat = "0%"
Columns("T:V").Select
Selection.NumberFormat = "#,##0.0000"
Columns("W:Y").Select
Selection.NumberFormat = "#,##0"
Cells.Select
Range("H1").Activate
Selection.Columns.AutoFit