VBA

Moderators: PavlinII
Number of threads: 1673
Number of posts: 3078

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
sum below until blank cell Posted by slong on 30 Oct 2012 at 7:38 AM
Hello,
I have a report that we convert from PDF into Excel every month and I need to total it by participant. I have pulled out the time from Col. B into Col. C so it can calculate. Next, I was going to have it look for the word "time", move 1 column right, then insert a function to add what is below it, not above it. There are varying lengths of rows, so I was going to have it add until it reached a blank cell. Then loop, or repeat, until there is no more data. Here is what I have that doesn't work.

' Find "Time" and move 1 cell to the right. Enter sum formula to add down until blank cell.
Cells.Find(What:="Time", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 1).Activate
ActiveCell.FormulaR1C1 = "=SUMPRODUCT(OFFSET(C3,,,MATCH(TRUE,C2:C65536="",)))"

I attached a sample of the data so you can see why I can't use subtotals or sum the cells above the active cell like normal. Any help is appreciated.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.