Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Remove Subtotal In Macro Not Working
Hello,
I built a macro using excel 97 that does a subtotal of a list of 100 - 5000 rows x 6 columns and later removes the subtotal. This macro took approximately 15 to 30 seconds to run using excel 97 under a win 98 platform. We finally upgraded to win xp and excel 2002. As soon as the macro runs the line "Selection.RemoveSubtotal", the whole thing reduces to a crawl and I end up having to blow off excel or it will sit for over 1/2 hour. I tried to run the macro to the point where the problem line exists and then do the remove subtotal manually but I receive the same result. Can you see any reason for this problem? Thanks, Jerry Selection.SUBTOTAL GroupBy:=3, Function:=xlCount, TotalList:=Array(3, 5), _ Replace:=True, PageBreaks:=False, SummaryBelowData:=True Columns("G:H").Select Selection.ClearContents Range("G2").Select ActiveCell.FormulaR1C1 = "=IF(RC[-2]=RC[-4],""X"","""")" Range("H2").Select ActiveCell.FormulaR1C1 = "=R[1]C[-1]" Range("B2").Select Selection.End(xlDown).Select ActiveCell.Offset(0, 5).Range("A1").Select ActiveCell.FormulaR1C1 = "x" ActiveCell.Offset(0, 1).Range("A1").Select ActiveCell.FormulaR1C1 = "x" Range("G2:H2").Select Selection.Copy Range(ActiveCell, ActiveCell.End(xlDown)).Select ActiveSheet.Paste Application.CutCopyMode = False Selection.Copy Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Application.CutCopyMode = False Range("A2").Select Selection.RemoveSubtotal |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Relative Cell position NOT working with or without macro | Excel Discussion (Misc queries) | |||
Macro or Formula to remove Text from Cells | Excel Worksheet Functions | |||
How do I remove the individual subtotal lines from a pivot table.. | Excel Discussion (Misc queries) | |||
Macro working in "This Workbook", but not while in "Personal.xls" | Excel Worksheet Functions | |||
Macro not working with Excel 2003 | Excel Discussion (Misc queries) |