AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Excel macro to print to pdf7/31/2023 Note: ActiveSheet refers to the currently active sheet only! So if you're trying to use this on another sheet it will reference "D2" in that current sheet. 'From your comment you've identified D2 as the file name.įileName = Create_PDF(ActiveSheet, MyFile, True, False) In the FileName = Create_PDF(ActiveSheet.Range("ReportArea"), MyFile, True, False) the object is the ActiveSheet so FileName = Create_PDF(ActiveSheet, MyFile, True, False) is sufficient. You've not defined the variable "ReportArea" anywhere in your code.Since PDFname and SelectedSchool are virtually doing the same thing it's redundant.You've not defined the variable "SelectedSchool" anywhere in your code.The SaveThisReport() section of your VBA code in its current state, is useless as, The workbook containing the macro can be downloaded here. MyFile = MyFolder
0 Comments
Read More
Leave a Reply. |