Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 12-15-2020, 02:10 PM
Purfleet Purfleet is offline Macro to print to pdf files showing pupil names Windows 10 Macro to print to pdf files showing pupil names Office 2019
Expert
 
Join Date: Jun 2020
Location: Essex
Posts: 345
Purfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to behold
Default

Sending to the printer should be easy enough - just add in activesheet.printout after the activesheet.exportasfixedformat. but this will print our each one every time - might be better to wrap an if around it to ask if the user wants to print

Code:
For Each c In inputRange
    r.Value = c.Value
    fName = c.Value
    '''' Save as pdf
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=FolderName & fName, _
        Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
        
    ActiveSheet.PrintOut
Next c
As for the name instead of a number it must be the fname part that is causing the issue - i am guessing that Cell S2 has the data validation number? but with out seeing the actual file it would be a guess - can you upload the actual file? or at least a test
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to print to pdf files showing pupil names Footers not showing in print preview nor will they print Lee_Lee Word 3 09-19-2017 05:06 AM
Macro to print to pdf files showing pupil names How do I import list of names from excel to print placecards? jrawls Word 2 08-17-2017 06:53 AM
Why 'print forms data' print pictures for DOCX files koolprasad2003 Word 4 05-09-2014 03:26 PM
Macro to print to pdf files showing pupil names VBA: How to debug.Print enumeration names? tinfanide Word VBA 4 01-27-2012 01:41 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:16 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft