Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
macro to add 24 rows to each group in column H
I need to add 24 rows to each service group in column H. The field is SG1,
SG2, SG3. For each subtotaled group at the end I need to add the 24 rows. The do until range line has an error. I also don't know how to make the insert line add 24 instead of only one. So this macro compares each offset row to see where the next service group starts and that is where I want the insert. Private Sub PutARowIn() Range("H12").Select Do Until Range(Range("R2"), Cells(Rows.Count, "R").End(xlUp)) If ActiveCell.Value = ActiveCell.Offset(-1, 0).Value Then ActiveCell.Offset(1, 0).Select Else ActiveCell.EntireRow.Insert ActiveCell.Offset(2, 0).Select End If Loop End Sub thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
macro to add 24 rows to each group in column H
reposted
"Janis" wrote: I need to add 24 rows to each service group in column H. The field is SG1, SG2, SG3. For each subtotaled group at the end I need to add the 24 rows. The do until range line has an error. I also don't know how to make the insert line add 24 instead of only one. So this macro compares each offset row to see where the next service group starts and that is where I want the insert. Private Sub PutARowIn() Range("H12").Select Do Until Range(Range("R2"), Cells(Rows.Count, "R").End(xlUp)) If ActiveCell.Value = ActiveCell.Offset(-1, 0).Value Then ActiveCell.Offset(1, 0).Select Else ActiveCell.EntireRow.Insert ActiveCell.Offset(2, 0).Select End If Loop End Sub thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Group into rows by every change of Column A | Excel Discussion (Misc queries) | |||
Group & sort rows that have a specific value in column C | Excel Worksheet Functions | |||
Macro to concatenate multiple rows in a column, without selecting each group manually | Excel Programming | |||
how would i select a group of rows based on a column value | Excel Programming | |||
macro to delete entire rows when column A is blank ...a quick macro | Excel Programming |