PrintLoop mass print all rows of data in file
How can I print and save all rows (pages) into a single file, rather than having to save each row as an individual PDF file. Currently the code below prints each row of data into individual PDF files. Sub PrintLoop() Dim LR As Long, i As Long Application.ScreenUpdating = False With Sheets("Labels Data File") LR = .Range("A" & Rows.Count).End(xlUp).Row For i = 2 To LR Sheets("Print Labels").Range("A1").Value = .Range("A" & i).Value Sheets("Print Labels").PrintOut Next i End With Application.ScreenUpdating = True End Sub: [![enter image description here]] I am currently trying to print the second screen shot without having to manually change the number circled red and print individual pages. I'm trying to print the whole file with one click.
Edit I understand your problem better now and changed my answer. My method below is a bit of a hack and could probably be simplified greatly but works if you don't mind a few extra steps. Run macro - (This prints-to-file which defaults to your documents folder) Sub PrintLoop() Dim LR As Long, i As Long Application.ScreenUpdating = False With Sheets("Labels Data File") LR = .Range("A" & Rows.Count).End(xlUp).Row For i = 2 To LR Sheets("Print Labels").Range("A1").Value = .Range("A" & i).Value Sheets("Print Labels").PrintOut Preview:=False, PrintToFile:=True, PrToFileName:="Lable_" & i Next i End With Application.ScreenUpdating = True End Sub Combine .prn files into one print file Open command prompt Navigate to folder with .prn files Type this: copy *.prn combinedfile.prn Delete all .prn files except combinedfile.prn Open command prompt Navigate to folder with .prn files Type this: for %i in (*.prn) do if not %i == combinedfile.prn del %i Convert .prn file to .pdf Try using Ghost script, see this post Steps 2, 3 & 4 could be setup in a batch script once you get it all working.
Convert Excel file to CSV - cannot supress Excel prompt window
How to fill data in excel sheet where date lies between a series of date ranges given in another sheet ? Also, a particular column should match
Altering an If equation to include a qualifier
ActiveX Controls resize when Excel 2010 file is opened
Excel VBA - keep on using excel while having a userform loaded
Run-time error '1004' - Method 'Range' of object'_Global' failed while deleting rows
Is this still considered a valid CSV file?
Excel VBA Code for copying 3 columns from sheet2 to sheet1 by matching a date and time stamp
excel return the value of a cell based on two other values
access vba macro from outside the excel file
Sorting issue excel
How to merge two worksheets entirely — with varying spreadsheet names, format, and worksheet titles
Excel VBA Print multiple named range in seperate page of PDF
Count non blank rows in a certain range/column Excel
Excel SUMIFS function not returning results consistently
Txt imported table empty rows deletion