Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2002: Need to increase capacity of selecting / deleting blan | Excel Discussion (Misc queries) | |||
Copying data from 1 worksheet and pasting to another skipping blan | Excel Discussion (Misc queries) | |||
Inserting rows and adding to total worksheet | Excel Discussion (Misc queries) | |||
2 questions - one about inserting the date, other about adding lines. | New Users to Excel | |||
How to avoid when linked source data is changed, chart turns blan. | Charts and Charting in Excel |