Davealot
Member
Greetings; I have used the macro builder along with some simple code to get an open order report that I used trimmed down to the information that I need to deliver to a specific set of people. The problem is I can't figure out how to get it to seperate between right hand and left hand parts. Right hand parts are designated with the "76200-76249" part series and Left hand parts are designated with the "76250-76299" series. What I would like is for this to print first the Right Hand parts, and then the Left Hand parts after I've got it all cut down. My code is as follows:
I've attached workbook, any help would be greatly appreciated, thank you kindly.
Code:
Option Explicit
Sub Run_Honda_Service_Printouts()
Columns("A:E").Select
Application.WindowState = xlMaximized
ActiveWorkbook.Worksheets("Open Order Report").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Open Order Report").Sort.SortFields.Add Key:=Range _
("C:C"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
ActiveWorkbook.Worksheets("Open Order Report").Sort.SortFields.Add Key:=Range _
("A:A"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Open Order Report").Sort
.SetRange Range("A:E")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True, _
IgnorePrintAreas:=False
Columns("A:E").Select
Application.WindowState = xlMaximized
ActiveWorkbook.Worksheets("Open Order Report").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Open Order Report").Sort.SortFields.Add Key:=Range _
("C:C"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
ActiveWorkbook.Worksheets("Open Order Report").Sort.SortFields.Add Key:=Range _
("A:A"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Open Order Report").Sort
.SetRange Range("A:E")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True, _
IgnorePrintAreas:=False
End Sub
I've attached workbook, any help would be greatly appreciated, thank you kindly.