View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Enter blank row after subtotal "Total"

Hi Missy,

See the adaptation in my response to your preceding post.

---
Regards,
Norman



"MissyLovesExcel" wrote in
message ...
Here 'tis:

'============
Public Sub Tester001()
Dim rng As Range
Dim rcell As Range
Dim i As Long
Const col As String = "A"

For i = Selection.Rows.Count To 2 Step -1
With Cells(i, col)
If .Value < .Offset(-1).Value Then
.EntireRow.Insert
End If
End With
Next i
End Sub
'<<============


"quartz" wrote:

It depends on how you structure the code. Mine inserts all the rows
first,
then adds the subtotals, so this is no problem. If you post your code
maybe I
can help...?

"MissyLovesExcel" wrote:

I didn't write the code so I don't know how to change it. That said,
wouldn't that still recognize the subtotal as a change in that column,
I
would get two rows before and after subtotal instead of one? - M

"quartz" wrote:

Hi,

It may be easiest to modify your macro to insert two rows where it
finds a
change rather than one. I use code like this myself...

HTH/

"MissyLovesExcel" wrote:

I have a macro for entering a blank row when there is a change in a
certain
column. However, after Subtotalling, it recognizes this Subtotal
line as a
change in that category, rightfully. Can someone provide a
solution/code to
enter a blank row after the Subtotal grouping? Thanks,
MissyLovesExcel