Good morning all
I've got a macro here that subtotals the number of cases and weight for each store in a list of many stores. Each store will have a different number of lines, based on the number of different products they are getting. After I subtotal, I insert rows 1 & 2 and need to write a couple of things in those lines.
What I want to do is insert rows one and two directly below the subtotal rows. I think that the problem is happening in my "INSTR" line close to the bottom of the macro.
Anyones help is greatly appreciated.
Sub PickList1()
'
' PickList1 Macro
' Macro recorded 5/26/2010 by Greg Moody
'
'
Range("J17").Select
ActiveWindow.SmallScroll Down:=-29
ActiveWindow.SmallScroll ToRight:=-8
Selection.Sort Key1:=Range("B2"), Order1:=xlAscending, Key2:=Range("C2") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom
Selection.Subtotal GroupBy:=3, Function:=xlSum, TotalList:=Array(13, 14, 15 _
, 16), Replace:=True, PageBreaks:=False, SummaryBelowData:=True
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Range("A1").Select
ActiveCell.FormulaR1C1 = "skids"
Range("E2").Select
ActiveCell.FormulaR1C1 = "weight"
If InStr(1, ActiveSheet.Column("C").Value, "Total") > 0 Then
End If
Rows("1:2").Select
Selection.Copy
Rows("7:7").Select
Selection.Insert Shift:=xlDown
Range("C8").Select
End Sub
Bookmarks