Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Help: Macro Adds Rows, Need to Update Totals with New rows

This is what i have for trying to update the formulas when new rows are
added:

Worksheets("Data").Cells(Worksheets("Data").UsedRa nge.Rows.Count,
8).FormulaR1C1 = _ "=SUM(H2:" & _
Worksheets("Data").Cells((Worksheets("Data").UsedR ange.Rows.Count - 1),
8) & ")"

Worksheets("Data").Cells(Worksheets("Data").UsedRa nge.Rows.Count,
9).FormulaR1C1 = _
"=SUM(I2:" & _
Worksheets("Data").Cells((Worksheets("Data").UsedR ange.Rows.Count - 1),
9) & ")"

Worksheets("Data").Cells(Worksheets("Data").UsedRa nge.Rows.Count,
10).FormulaR1C1 = _
"=SUM(J2:" & _
Worksheets("Data").Cells((Worksheets("Data").UsedR ange.Rows.Count - 1),
10) & ") +" _
& Worksheets("Data").Cells(Worksheets("Data").UsedRa nge.Rows.Count,
6).Value

Obviously, it doesn't work as submitted. I'm pretty sure the problem is
in the formula, specifically, when I try to reference the new range i
want to work with. I have an idea of what the problem is, I just can't
for the life of me figure out how to change it to make it work properly

I would also like to make these formulas instead only display the sum
of the visible rows (on the last formula, i would also like it to only
add the cell in column 6 if all the rows are visible, note there is a
column hidden that will always remain hidden)

Subtotal will not work because i'm not using filters when the rows are
hidden

thanks for the help everybody, you've all been great with every
question i've asked in the past

i know everybody helps when they have time so, even though i'd like to
say i need the help ASAP, i understand its never reasonable, so, when
you have time it would be wonderful

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Help: Macro Adds Rows, Need to Update Totals with New rows

Sorry about the code, i tried to make it fit (it fit properly in the
posting window but not after it posted)

Matt wrote:
This is what i have for trying to update the formulas when new rows are
added:

Worksheets("Data").Cells(Worksheets("Data").UsedRa nge.Rows.Count,
8).FormulaR1C1 = _ "=SUM(H2:" & _
Worksheets("Data").Cells((Worksheets("Data").UsedR ange.Rows.Count - 1),
8) & ")"

Worksheets("Data").Cells(Worksheets("Data").UsedRa nge.Rows.Count,
9).FormulaR1C1 = _
"=SUM(I2:" & _
Worksheets("Data").Cells((Worksheets("Data").UsedR ange.Rows.Count - 1),
9) & ")"

Worksheets("Data").Cells(Worksheets("Data").UsedRa nge.Rows.Count,
10).FormulaR1C1 = _
"=SUM(J2:" & _
Worksheets("Data").Cells((Worksheets("Data").UsedR ange.Rows.Count - 1),
10) & ") +" _
& Worksheets("Data").Cells(Worksheets("Data").UsedRa nge.Rows.Count,
6).Value

Obviously, it doesn't work as submitted. I'm pretty sure the problem is
in the formula, specifically, when I try to reference the new range i
want to work with. I have an idea of what the problem is, I just can't
for the life of me figure out how to change it to make it work properly

I would also like to make these formulas instead only display the sum
of the visible rows (on the last formula, i would also like it to only
add the cell in column 6 if all the rows are visible, note there is a
column hidden that will always remain hidden)

Subtotal will not work because i'm not using filters when the rows are
hidden

thanks for the help everybody, you've all been great with every
question i've asked in the past

i know everybody helps when they have time so, even though i'd like to
say i need the help ASAP, i understand its never reasonable, so, when
you have time it would be wonderful


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Help: Macro Adds Rows, Need to Update Totals with New rows

Anybody have any ideas for this?

Matt wrote:
Sorry about the code, i tried to make it fit (it fit properly in the
posting window but not after it posted)

Matt wrote:
This is what i have for trying to update the formulas when new rows are
added:

Worksheets("Data").Cells(Worksheets("Data").UsedRa nge.Rows.Count,
8).FormulaR1C1 = _ "=SUM(H2:" & _
Worksheets("Data").Cells((Worksheets("Data").UsedR ange.Rows.Count - 1),
8) & ")"

Worksheets("Data").Cells(Worksheets("Data").UsedRa nge.Rows.Count,
9).FormulaR1C1 = _
"=SUM(I2:" & _
Worksheets("Data").Cells((Worksheets("Data").UsedR ange.Rows.Count - 1),
9) & ")"

Worksheets("Data").Cells(Worksheets("Data").UsedRa nge.Rows.Count,
10).FormulaR1C1 = _
"=SUM(J2:" & _
Worksheets("Data").Cells((Worksheets("Data").UsedR ange.Rows.Count - 1),
10) & ") +" _
& Worksheets("Data").Cells(Worksheets("Data").UsedRa nge.Rows.Count,
6).Value

Obviously, it doesn't work as submitted. I'm pretty sure the problem is
in the formula, specifically, when I try to reference the new range i
want to work with. I have an idea of what the problem is, I just can't
for the life of me figure out how to change it to make it work properly

I would also like to make these formulas instead only display the sum
of the visible rows (on the last formula, i would also like it to only
add the cell in column 6 if all the rows are visible, note there is a
column hidden that will always remain hidden)

Subtotal will not work because i'm not using filters when the rows are
hidden

thanks for the help everybody, you've all been great with every
question i've asked in the past

i know everybody helps when they have time so, even though i'd like to
say i need the help ASAP, i understand its never reasonable, so, when
you have time it would be wonderful


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
Importing html documents into Excel adds rows to the body. Dave Murdock Excel Discussion (Misc queries) 1 April 14th 09 01:58 AM
Macro to import & update rows in spreadsheet based on Ref ID. Harry Seymour[_2_] Excel Discussion (Misc queries) 0 June 9th 08 04:05 PM
Calculated Item in Pivot Table Adds Rows with Zero Values Marc Forget Excel Discussion (Misc queries) 0 July 16th 07 06:24 PM
shared file adds or deletes rows woodman Excel Discussion (Misc queries) 0 May 31st 07 04:46 PM
worksheet adds 1 or 2 values to totals UnhappyC Excel Worksheet Functions 1 August 16th 06 03:24 PM


All times are GMT +1. The time now is 01:57 AM.

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

About Us

"It's about Microsoft Excel"