Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob Bob is offline
external usenet poster
 
Posts: 972
Default Adding a set of numbers and inserting a blan row

In column A I have data sorted by cities. In column D I have a column with a
duration in 5, 10, 15, 20, 25 and 30.

I have the following which counts the duration for each city in column A:

With ActiveSheet

LastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = LastRow + 1 To 2 Step -1

If .Cells(i, "A").Value < .Cells(i - 1, "A").Value Then

For j = 30 To 5 Step -5

.Rows(i).Insert
.Cells(i, "D").Value = j
.Cells(i, "E").Formula = _
"=SUMPRODUCT(--(A1:A" & LastRow & "=""" & _
.Cells(i - 1, "A").Value & """),--(d1:d" &
LastRow & "=" & j & "))"

If .Cells(i, "d").Value = 0 Then Rows(i).Delete
Next j
End If
Next i

End With

What I need now is to total the values in column E in the next row and then
add a blank row.
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
Excel 2002: Need to increase capacity of selecting / deleting blan Mr. Low Excel Discussion (Misc queries) 2 May 6th 09 02:28 PM
Copying data from 1 worksheet and pasting to another skipping blan Concertgoer Excel Discussion (Misc queries) 1 October 1st 08 12:30 AM
Inserting rows and adding to total worksheet SU123 Excel Discussion (Misc queries) 3 September 12th 08 01:30 PM
2 questions - one about inserting the date, other about adding lines. FAJITA New Users to Excel 7 July 16th 06 12:52 PM
How to avoid when linked source data is changed, chart turns blan. Chris S (Belgium) Charts and Charting in Excel 0 March 9th 06 01:10 PM


All times are GMT +1. The time now is 02:41 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"