excel


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][2]][2]
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.

Related Links

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

Categories

HOME
powershell-v4.0
statistics
autodesk-forge
modularity
google-speech-api
scenekit
node-red
import
post
contiki
jaxb
http-headers
purescript
crc
treeset
dijkstra
cloudify
serenity-bdd
twitter-streaming-api
couchbase-view
sitefinity
xmlstarlet
indexoutofrangeexception
avaya
floyd-warshall
lwip
wasapi
inorder
chmod
ecore
initializing
pi
redhat-bpm
simplemodal
yield
audiounit
tinyxml2
wso2dss
monocle-scala
smartmeter
dispy
vqmod
gyp
rpy2
nsoutlineview
smart-pointers
gio
imshow
mockery
mapfragment
ienumerable
website-deployment
testdroid
grid-layout
customdialog
listboxitem
pragma
rgraph
mindbody
mks-integrity
pagerslidingtabstrip
argo
xamarin-forms
pull-request
authentication-flows
html5-template
dynamic-ip
puphpet
kirby
apache-wink
jaggery-js
mooc
runscope
android-handlerthread
cxf-client
restriction
numpad
kif-framework
firstdata
wxgrid
mashup
stockquotes
set-theory
customer-support
silverlight-embedded
entityreference
executequery
abbreviation
resource-cleanup
o3d

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App