• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Help with printing specific part numbers in a series

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:

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.
 

Attachments

  • OrderReport.xls
    41 KB · Views: 3
Hi !

A beginner must resolve this just by using an easy worksheet formula
to point out if data in column A is Right or Left ! Formula in F2 cell :

=IF(LEFT(A2,5)<LEFT(A2,3)&"50","R","L")

Copy down … Now you can filter your range for "R" or "L" !
 
Hi !

A beginner must resolve this just by using an easy worksheet formula
to point out if data in column A is Right or Left ! Formula in F2 cell :

=IF(LEFT(A2,5)<LEFT(A2,3)&"50","R","L")
Copy down … Now you can filter your range for "R" or "L" !​

Marc,
Thank you for your time, I failed to mention something my apologies; What I'm wanting it to do is to automatically print out, as part of the macro, Just the RH parts and then Just the LH parts all at once. Ideally I just flop the open order in excel, hit the macro and it sends it out to default printer, which I would change before running this macro so that it prints to their printers, thank you for your help good sir.
 
Back
Top