Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search for subtotals
I wld like to start at cell D3. Then search for any subtotals downwards.
If found, say cell D15, outline the upper border (ie btw D14 & D15), and insert a line below D15 (I find this difficult becos inserted line is always above, not below) This should continue until end of data rows. Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search for subtotals
Hi
try the following macro. It tests column A and inserts a blank row if the word 'subtotal' is found Sub insert_rows() Dim lastrow As Long Dim row_index As Long lastrow = ActiveSheet.Cells(Rows.count, "A").End(xlUp).row For row_index = lastrow - 1 To 1 Step -1 If InStr(Cells(row_index, "A").Value,"Subtotal")0 then Cells(row_index + 1, "A").EntireRow.Insert (xlShiftDown) End If Next End Sub -- Regards Frank Kabel Frankfurt, Germany Teak wrote: I wld like to start at cell D3. Then search for any subtotals downwards. If found, say cell D15, outline the upper border (ie btw D14 & D15), and insert a line below D15 (I find this difficult becos inserted line is always above, not below) This should continue until end of data rows. Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search for subtotals
Thanks Frank. Will try out the macro.
*** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Subtotals problem: Excel 2003 (not, AFAIK, the nested subtotals bug) | Excel Discussion (Misc queries) | |||
Original subtotals should not be within nested subtotals in excel | Excel Worksheet Functions | |||
Subtotals: Nested subtotals below higher subtotal | Excel Discussion (Misc queries) | |||
Problem with nested subtotals, placing secondary subtotals BELOW . | Excel Discussion (Misc queries) | |||
why are nested subtotals coming out below outer subtotals? | Excel Worksheet Functions |