Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 155
Default Programmatically calculating formulas for new entries

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating the number of entries between 2 times Bonzai Excel Worksheet Functions 2 January 11th 10 07:23 AM
Calculating Duplicate Entries Bad_Shot[_2_] New Users to Excel 14 January 30th 09 12:28 AM
HELP!! Change formulas programmatically -- all I get is text! Sandy Excel Programming 7 September 30th 05 12:23 AM
calculating entries John Excel Worksheet Functions 1 September 28th 05 06:54 AM
Programmatically validate text entries in Microsoft Excel Asha Excel Programming 2 October 28th 04 12:49 PM


All times are GMT +1. The time now is 09:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"