View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Programmatically calculating formulas for new entries

Sub Fillformulas()
Dim rng As Range, lastRow As Long
Dim cell As Range
Set rng = Rows(2).SpecialCells(xlFormulas)
lastRow = Cells(Rows.Count, 1).End(xlUp).Row
If lastRow 2 Then
For Each cell In rng
cell.Offset(1, 0).Resize(Rows.Count - 2, 1).ClearContents
cell.Resize(lastRow - 1, 1).Formula = cell.Formula
Next
End If

End Sub

Might give you some ideas. I have made a lot of assumptions. I assume you
have data starting in A2 with headers in row 1 and your formulas are at least
in row 2. Also, that column 1 can be used to determine the extent of the
data.

If you want to just test it, do it on a copy of your data/workbook.

--
Regards,
Tom Ogilvy


"Carlee" wrote:

Hi there,

I have a series of data that is imported into specific rows/columns. There
are a number of calculated columns, that for now, i have to copy and paste
down to each new row.

Question: is there a way to have the calculations done with out having to
manually pull them down to each new row?
--
Carlee