View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
david mcritchie david mcritchie is offline
external usenet poster
 
Posts: 691
Default inserting row...but the formula is not affected

Hi Monika,
Instead of coding for cell J52: as
=SUM(J7:J51)
code as
=SUM(J$7:OFFSET(J52,-1,0))
then you can insert a row immediately before your total row
(row 52) with SUM.

For more information on inserting rows and the use of
OFFSET see
http://www.mvps.org/dmcritchie/excel...row.htm#offset
then there is not need to code a blank row above your
total and for which you have no assurance that someone
would not put an amount on that blank row.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

From: "monika"
Newsgroups: microsoft.public.excel.programming
Sent: Monday, April 19, 2004 04:57 AM
Subject: inserting row...but the formula is not affected


I am inserting a row by Rows(fndVal1.Row).Insert. Now i
have formulas like =SUM(J7:J51) in rows after the new row [clipped]