Print Preview Display for Specific Worksheets in Excel

文章推薦指數: 80 %
投票人數:10人

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



請為這篇文章評分?