Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
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
  #2  
Old 12-16-2020, 01:53 AM
Richystab Richystab is offline Macro to print to pdf files showing pupil names Windows 10 Macro to print to pdf files showing pupil names Office 2019
Novice
Macro to print to pdf files showing pupil names
 
Join Date: Dec 2020
Posts: 12
Richystab is on a distinguished road
Default file attached

Hi. Master attached,

VBA is above my skills! so any help is very appreciated. I was sent this spreadsheet!
Thankyou
Attached Files
File Type: xlsm School Report Y8 (MASTER).xlsm (386.4 KB, 7 views)
Reply With Quote
Reply

Thread Tools
Display Modes


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 03:58 PM.


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