LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 334
Default Add sum to dynamic range in Macro

I download a report into Excel and I have created a macro to reformat it so
it is easy to read.

I want to add totals at the bottom of each section break. The problem I have
is that I don't know how big each section is as it changes from month to
month. when I add the section breaks I use;

ActiveCell.Offset(2, 0).End(xlDown).Resize(10, 14).Select
Selection.ClearContents
ActiveCell.Resize(7, 14).Select
Selection.Delete Shift:=xlUp

Which takes the cells I don't want and deletes and clears them out leaving 3
blank lines.

There are several of these sections of various lengths and I want to add
total to the bottom of each of them, there are 6 columns in each section.

How do I get the formula to add all cells above up to the first blank cell?

Thanks in advance
Rick

 
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
Dynamic Range Name Macro Jonathan Cooper Excel Discussion (Misc queries) 3 March 24th 08 09:04 PM
dynamic range in a macro MJKelly Excel Programming 2 November 19th 07 11:48 PM
dynamic range based on criteria, within a dynamic range, passed to a function [email protected] Excel Programming 5 October 9th 07 10:13 PM
creating a dynamic range based on criteria, within a dynamic range, and passing it to a function [email protected] Excel Programming 0 October 9th 07 05:22 PM
Dynamic range for autofill macro Jim G Excel Discussion (Misc queries) 2 April 23rd 07 05:46 AM


All times are GMT +1. The time now is 03:10 PM.

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"