Hello,
I have this script:
and I would like to add this sub() right under the lines:
Can anyone help me?
Thanks and best regards to all....with admiration!!!
iR</code></code>
I have this script:
Rich (BB code):
<code style="margin: 0px; padding: 0px; font-style: inherit; font-weight: inherit; line-height: 12px;">Sub saveInvNew() 'Save record to Master Sheet
Sheets("Invoice").Unprotect
Sheets("Master").Unprotect
On Error GoTo ErrHandler
Dim cpyArr, wbMas As Worksheet, qClr As String, ansCl As String, wbInv As Worksheet
'ActiveSheet.Unprotect
With Worksheets("Master")
.Range("A1").CurrentRegion.Sort Key1:=.Range("A1"), _
Order1:=xlAscending, Header:=xlYes
End With
cpyArr = Array(Range("B13").Value, Range("C13").Value, Range("f16").Value, Range("c16").Value, Range("a8").Value, Range("J15").Value, Range("e16").Value, Range("a16").Value, Range("A18").Value, Range("b18").Value, Range("F13").Value, Range("f18").Value, Range("f41").Value, Range("f33").Value, Range("r6").Value, Range("r4").Value, Range("m6").Value, Range("m4").Value, Range("n17").Value, Range("s16").Value, Range("s18").Value, Range("S43").Value, Range("S44").Value, Range("S45").Value)
Set wbMas = Worksheets("Master")
Set wbInv = Worksheets("Invoice")
wbMas.Range("A" & wbMas.Cells(Rows.Count, "A").End(xlUp).Row + 1).Resize(, 24) = cpyArr
qClr = "Do you wish to print a copy of the invoice sheet?"
ansCl = MsgBox(qClr, vbYesNo + vbQuestion, "Print Invoice Sheet?")
If ansCl = vbYes Then
wbInv.PageSetup.PrintArea = "$A$1:$g$56"
wbInv.PrintOut copies:=1
End If
Sheets("Invoice").Protect
Sheets("Master").Protect
fsy
clrInv
Exit Sub
ErrHandler:
MsgBox "Error with Invoice (Save New Invoice)- error " & Err.Number & _
" - " & Err.Description
End Sub
and I would like to add this sub() right under the lines:
Rich (BB code):
wbInv.PrintOut copies:=1
End If
Rich (BB code):
<code style="margin: 0px; padding: 0px; font-style: inherit; font-weight: inherit; line-height: 12px;">Sub Create_PDF()
'
' Create_PDF Macro
'
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
ActiveWorkbook.Path & "\Invoicing\PDF Files\" & ActiveWorkbook.Name, Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=False
End Sub
Can anyone help me?
Thanks and best regards to all....with admiration!!!
iR</code></code>