Hello guys, hope you're doing good
So my problem is i have a task at hand with complex features or codes. I found the codes seperately and every one works good but when I try to add them together the code does not work. I want to fill a template according to ce cells and print the template and save it as pdf. and I want it to loop until a blank cell from A2,A3,A4,......., until blank. So here are my codes
Print code:
the save as pdf code:
So my problem is i have a task at hand with complex features or codes. I found the codes seperately and every one works good but when I try to add them together the code does not work. I want to fill a template according to ce cells and print the template and save it as pdf. and I want it to loop until a blank cell from A2,A3,A4,......., until blank. So here are my codes
Print code:
VBA Code:
Sub print1()
'
' print1 Macro
' print 1 row without loop
'
'
Sheets("Feuil1").Select
Range("A2").Select
Selection.Copy
Sheets("canva").Select
ActiveSheet.Paste
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
:=True, IgnorePrintAreas:=False
End Sub
the save as pdf code:
VBA Code:
Sub SaveAsPDF()
'Saves active worksheet as pdf using concatenation
'of A2
Dim fName As String
With ActiveSheet
fName = .Range("A2").Value
.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\My Documents\" & fName, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
End With
End Sub
Last edited by a moderator: