Hi, I would like to use the vlookup/if statement below to call a macro. If the "Y" is absent, then I dont want the macro to run. If someone could provide the correct format I would appreciate it. It is written in the code below. Thanks
IF(VLOOKUP(FINALORDER!D4,DEALERLIST!$A$3:$O$20,15,FALSE)="Y" Then
Call QUOTE_INVOICE_PDF
End If
IF(VLOOKUP(FINALORDER!D4,DEALERLIST!$A$3:$O$20,15,FALSE)="Y" Then
Call QUOTE_INVOICE_PDF
End If
VBA Code:
Sub PRINT_ADAM_4_FORMS()
'Revision - Added INVOICE copies condition
' 11/04/2019 - Chris at Lum Computer Services lumcs50@yahoo.com
'
response = MsgBox("THIS WILL PRINT YOUR FORMS - ARE YOU SURE?", vbYesNo)
If response = vbNo Then
Exit Sub
End If
Application.Dialogs(xlDialogPrinterSetup).Show
Application.ScreenUpdating = False
Call PARTS_LIST_PRINT 'STEVE ADDED 11/14/21 12/1/21 MOVED THIS LINE SO PARTS LIST PRINTS FIRST PER ADAM REQUEST
Worksheets("MASTER FORM").PrintOut Copies:=2
Worksheets("PACK SLIP").PrintOut
If Worksheets("FINALORDER").Range("F5").Value = "BA" Then
Worksheets("INVOICE").PrintOut Copies:=3
Else
Worksheets("INVOICE").PrintOut Copies:=1 'this will print 1 full copy of the invoice which goes to customer
Worksheets("INVOICE").PrintOut from:=1, To:=1, Copies:=1 '1/27/20 Steve added this to print just tghe first page of the 2nd copy of invoice which stays with us.
End If
[SIZE=4]IF(VLOOKUP(FINALORDER!D4,DEALERLIST!$A$3:$O$20,15,FALSE)="Y" Then
Call QUOTE_INVOICE_PDF
End If[/SIZE]
ActiveSheet.Select
Application.ScreenUpdating = True