Print Preview Display for Specific Worksheets in Excel
文章推薦指數: 80 %
Macro to Display Print Preview for Specific Worksheets in Excel ... To display the print preview mode for the desired worksheet in Excel, replace " ... CreateAccount Email: Pass: Pass? Joinover20,000People! ExcelTipsinYourEmail ExcelCourses ShoppingCart Empty ViewCart ForumTutorialsMacros ExcelCourses VBAProjects Forum Tutorials Macros Resources Blog FreeExcelCourses ExcelVideoTutorials ExcelKeyboardShortcuts Contact Macros ExcelTutorialsForMacros PremiumExcelCourseNowAvailable! BuildProfessional-Unbreakable-FormsinExcel 45Tutorials-5+Hours-DownloadableExcelFiles InstantAccess!-LifetimeAccess! ViewCourse PrintPreviewDisplayforSpecificWorksheetsinExcel Edit AddtoFavorites Favorited Author:don ThisfreeExcelmacroallowsyoutodisplaytheprintpreviewmodeorwindowinExcelforaspecifiedExcelworksheet.Thisisagreatmacrotousewithworkbookswhoseworksheetswillnotchangeorfortemplates. Wheretoinstallthemacro: Module MacrotoDisplayPrintPreviewforSpecificWorksheetsinExcel TodisplaytheprintpreviewmodeforthedesiredworksheetinExcel,replace"WorksheetNameGoesHere"withtheactualnameoftheworksheet,whichislocatedonthetab.Youcanalsosetthisequaltoavariableandthenuseauserinputformorsomeothermethodtodynamicallypullinthenameofaworksheettoviewintheprintpreviewmode. SubPrint_Preview_SpecificWorksheet() 'ShowtheprintpreviewwindowforaspecificExcelworksheet Worksheets("WorksheetNameGoesHere").PrintPreview EndSub MacrotoDisplayPrintPreviewfortheSelectedWorksheets ActiveWindow.SelectedSheets.PrintPreview ExcelVBACourse-FromBeginnertoExpert 200+VideoLessons 50+HoursofInstruction 200+ExcelGuides BecomeamasterofVBAandMacrosinExcelandlearnhowtoautomateallofyourtasksinExcelwiththisonlinecourse.(NoVBAexperiencerequired.) ViewCourse () SimilarContentonTeachExcel PrintSelectedWorksheetsinExcel Macro:ThisfreeexcelmacrowillprintallselectedworksheetsinExcel.Iftherearenoot... CopyDataorFormattingtoMultipleWorksheetsinExcel Tutorial: Quicklycopyallorpartsofasingleworksheet-data,formatting,orboth-tomultiple... PrintPreviewScreenDisplayforTheCurrentorSelectedWorksheetsinExcel Macro:ThisfreeExcelmacroallowsyoutodisplaytheprintpreviewscreenorwindowforthecur... PrintPreviewScreenDisplayforTheEntireWorkbookinExcel Macro:ThisfreeExcelmacroallowsyoutoquicklyandeasilydisplaytheprintpreviewwindo... PrintOnlySpecificPartsofaWorksheetinExcel Tutorial:InExcelyoucanselectpartsofaworksheettoprintwhileignoringalloftheotherdata... PrintSpecificPagesinExcel Macro:ThisfreeExcelmacroallowsyoutoprintapre-specifiedselectionofpagesfromExcel.T... HowtoInstalltheMacro Selectandcopythetextfromwithinthegreyboxabove. OpentheMicrosoftExcelfileinwhichyouwouldliketheMacrotofunction. Press"Alt+F11"-ThiswillopentheVisualBasicEditor-WorksforallExcelVersions. OrForotherwaystogetthere,ClickHere. ForExcelVersionsPriortoExcel2007GotoTools>Macros>VisualBasicEditor ForExcel2007GotoOfficeButton>ExcelOptions>Popular>ClickShowDevelopertabintheRibbon.ThengototheDevelopertabontheribbonmenuandonthefarleftClickVisualBasic Onthenewwindowthatopensup,gototheleftsidewheretheverticalpaneislocated.LocateyourExcelfile;itwillbecalledVBAProject(YOURFILE'SNAMEHERE)andclickthis. IftheMacrogoesinaModule,ClickHere,otherwisecontinuetoStep8. GotothemenuatthetopofthewindowandclickInsert>Module AnotherwindowshouldhaveopenedwithintheVisualBasicEditor'swindow.Withinthisnewwindow,pastethemacrocode.Makesuretopastethecodeunderneaththelastlineofanythingelsethatisinthewindow. GotoStep8. IftheMacrogoesintheWorkbookorThisWorkbook,ClickHere,otherwisecontinuetoStep8. DirectlyunderneathyourexcelfilecalledVBAProject(yourfile'snamehere),clicktheMicrosoftExcelObjectsfoldericontoopenthatdrop-downlist. Then,atthebottomofthelistthatappears,double-clicktheThisWorkbooktext. AnewwindowinsidetheVisualBasicEditor'swindowwillappear.Inthisnewwindow,pastethecodeforthemacro.Makesuretopastethiscodeunderneaththelastlineofanyothercodewhichisalreadyinthewindow. GotoStep8. IftheMacrogoesintheWorksheetCode,ClickHere,otherwisecontinuetoStep8. DirectlyunderneathyourexcelfilecalledVBAProject(yourfile'snamehere),clicktheMicrosoftExcelObjectsfoldericontoopenthatdrop-downlist. Withinthelistthatappearsyouwillseeeveryworksheetthatisinthatexcelfile.Theywillbelistedassuch:Sheet1(NAMEOFSHEETHERE)andunderthatwillbeSheet2(NAMEOFSHEETHERE).Selectthesheetinwhichyouwantthemacrotorunanddouble-clickthatsheet. AnewwindowinsidetheVisualBasicEditor'swindowwillappear.Inthisnewwindow,pastethecodeforthemacro.Makesuretopastethiscodeunderneaththelastlineofanyothercodewhichisalreadyinthewindow. Repeatstepsbandcforeverysheetyouwantthemacrotoworkin.Puttingthemacroinonesheetwillnotenableitforanyothersheetsintheworkbook. GotoStep8. ClosetheMicrosoftVisualBasicEditorwindowandsavetheExcelfile.WhenyouclosetheVisualBasicEditorwindow,theregularExcelwindowwillnotclose. Youarenowreadytorunthemacro. TutorialDetails SimilarContent PrintSelectedWorksheetsinExcel Macro:ThisfreeexcelmacrowillprintallselectedworksheetsinExcel.Iftherearenoot... CopyDataorFormattingtoMultipleWorksheetsinExcel Tutorial: Quicklycopyallorpartsofasingleworksheet-data,formatting,orboth-tomultiple... PrintPreviewScreenDisplayforTheCurrentorSelectedWorksheetsinExcel Macro:ThisfreeExcelmacroallowsyoutodisplaytheprintpreviewscreenorwindowforthecur... ExcelVBACourse-FromBeginnertoExpert 200+VideoLessons 50+HoursofVideo 200+ExcelGuides BecomeamasterofVBAandMacrosinExcelandlearnhowtoautomateallofyourtasksinExcelwiththisonlinecourse.(NoVBAexperiencerequired.) ViewCourse () Contact|PrivacyPolicy|Disclaimer|Terms Copyright©2022TeachExcel.com
延伸文章資訊
- 1How to Display Print Preview with Excel VBA (3 Macros)
1. VBA Macro to Display Print Preview for the Active Sheet · Right-click on the sheet title. · Th...
- 2VBA Print | How to Use Print Function in Excel VBA with examples?
- 3Create a Print button [VBA] - Get Digital Help
- 4Create a Macro in Excel for printing by Chris Menard - YouTube
- 5Excel 365 Print Preview - vba - Stack Overflow
BTW - Using the .PrintPreview method in Word 365 VBA brings up the 365 PrintPreview dialogue, as ...