Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Set a variable to hold the latest row number where the cumulative sum adds
to zero. So each time the cumulative sum hits zero, set this variable to that row. Then when you get the the 1000th row, write rows 1 through the number of the row held in that variable. Then adjust your row counter to account for the rows not written. -- Regards, Tom Ogilvy "Paul" <paulm dot c @ iol dot ie wrote in message ... Hi, I'm writing a macro to create a csv file from a spreadsheet that has to be formatted in a certain way. One rule for the csv I'm getting stuck on is as follows: The speadsheet could contain say 20000 lines. The fields could be Journal number, description, Amount. As I extract each row, the code should find the nearest row to 1000 where the amounts evaluate to zero (the amounts are pluses and minuses) at which point I can apply specific fomating to that row in the csv extract then to start the count again from 1 and find the next nearest row to 1000 and again apply the specific formatting to that row in the csv extract. I'm thinking that I could step through each row and add the amounts (amount = amount + amount) but the problem is the formatting should occur at the NEAREST point to 1000 rows as possible. How do I get the code to count back from 1000 to find that point if when I'm adding the amounts I'm starting from 1 and counting up. Any advise appreciated Paul |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional Formatting - find cells containg "+" | Excel Discussion (Misc queries) | |||
Find formatting doesn't work: "Excel cannot find data" | Excel Discussion (Misc queries) | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) | |||
programmaticaly test more then 1000 excel files for "opening Errors" | Excel Programming |