
Originally Posted by
jstephens
I'm not 100% sure what you're asking, can you post an example of what you have pre-macro and then the desired results?
One thing to remember is that when deleting columns, you always want to go right to left since if you delete Column C, Column D will become Column C.
I am sorry for the dely in this post. I did get the macro to work however I have to run each step separately for it to run correctly....maybe you can shed some light on the glitch??
Sub Step1()
Range("A4:J992").Select
Range("F4:F996").Replace 0, "", xlWhole
Range("F4:F996").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End Sub
Sub Step2()
ActiveWorkbook.Worksheets("47th Ave").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("47th Ave").Sort.SortFields.Add Key:=Range( _
"C4:C992"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
ActiveWorkbook.Worksheets("47th Ave").Sort.SortFields.Add Key:=Range( _
"D4:D992"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
ActiveWorkbook.Worksheets("47th Ave").Sort.SortFields.Add Key:=Range( _
"E4:E992"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("47th Ave").Sort
.SetRange Range("A4:J992")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Columns("C:C").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("C4").Select
ActiveCell.FormulaR1C1 = "=RC[1]&"" ""&RC[2]&"" ""&RC[3]"
Range("C4").Select
Selection.AutoFill Destination:=Range("C4:C935"), Type:=xlFillDefault
Range("C4:C935").Select
Columns("C:C").EntireColumn.AutoFit
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("D:F").Select
Selection.Delete Shift:=xlToLeft
Range("A4:H925").Select
Selection.Replace What:="LBS", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=True, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Subtotal GroupBy:=3, Function:=xlSum, TotalList:=Array(4, 8), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
End Sub
Sub Step3()
For i = 3 To Cells(Rows.Count, 3).End(xlUp).Row
If Cells(i, 3) Like "*Total*" Then
Rows(i).EntireRow.Font.Bold = True
End If
Next i
End Sub
Bookmarks