Bhuvan Kumar
New Member
- Joined
- Jan 29, 2018
- Messages
- 2
I created an excel workbook which contains 2 sheet. In one sheet there is data. From the 1 sheet a bill format is made by giving v lookup.
I went for a macro for printing the bills whereas the bill created is replacing the earlier.
This is the code.
Sub PrintBill2()
'
' PrintBill2 Macro
'
' Keyboard Shortcut: Ctrl+Shift+P
'
Sheets(" Bill of Supply").Select
Range("A2:I2").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlUp)).Select
Range("A2:I36").Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\PC-1\Documents\Downloads\1.pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
End Sub
I want a file name based on invoice number which changes from invoice to invoice.
let me know what changes i need to done in the code.
I went for a macro for printing the bills whereas the bill created is replacing the earlier.
This is the code.
Sub PrintBill2()
'
' PrintBill2 Macro
'
' Keyboard Shortcut: Ctrl+Shift+P
'
Sheets(" Bill of Supply").Select
Range("A2:I2").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlUp)).Select
Range("A2:I36").Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\PC-1\Documents\Downloads\1.pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
End Sub
I want a file name based on invoice number which changes from invoice to invoice.
let me know what changes i need to done in the code.