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

Get the length of decimal places
Excel Formula to copy cell value to a column based on condition
Excel Webservice Function Yahoo Finance
Using a dynamic cell value in excel VBA
Excel VBA gives type mismatch on dividing decimal numbers after split
Get data from a website table to the excel sheet
VBA Set Dropdown value
VBA Access to Excel export, Error 1004 and 70 when re-running the script
Excel 2010 if condition occurs in column
Do Until loop gives Unknown Runtime Error in VBScript
Count distinct words in the row and paste the count in sheet 2
Adjusting the formula in formulaarray
Convert a URL formatted content to plain text in microsoft EXCEL
Using arrays inside functions in VBA
using two recordset vba excel
many multiple conditional checks in single excel function

Categories

HOME
.htaccess
docker
rstudio
perl
qt5
google-maps-api-3
inno-setup
graphite
function
statistics
google-speech-api
speech-recognition
uiviewcontroller
facebook-live-api
google-cloud-endpoints
vaadin-grid
vbulletin
visio
outlook-redemption
lokijs
adodb-php
beatbox
cider
face-api
django-channels
sandbox
rubinius
floyd-warshall
dsolve
polymer-starter-kit
fxml
graphic
podcast
sequences
nestedscrollview
quickbooks-online
cassandra-3.0
ats
uievent
configuration-files
cartography
burn
audiounit
subtitle
mypy
android-datepicker
orphan
idfa
iis-8.5
testdroid
orchardcms-1.9
listboxitem
gridster
pdl
avm2
angularjs-ng-options
kiosk-mode
review
google-plugin-eclipse
vtune
zend-http-client
nxt-python
code-metrics
n-tier
invalidation
wxgrid
pyro
chaplinjs
texmacs
fluent-security
gideros
android.mk
remotipart
mathtype
vp8
badimageformatexception
customvalidator
dotfuscator
mobile-phones
continuations
xcode4.1
ant4eclipse
dynamic-css
olpc
astoria

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