filmov
tv
Excel VBA Tutorial: Click on icon to run print preview (or any VBA code) by assigning macro to shape

Показать описание
// FREE Excel E-book "Record Your First Macro"
// Recommended Excel Courses //
// Recommended Excel Templates //
If you are looking for pre-built, easy to use spreadsheets, check out Simple Sheets.
They have Excel templates covering cash flow planning, invoices, expense reports, personal budgets, and more!
——
// EPISODE NOTES
In this tutorial video we look at how to set up a Print Button on any Excel worksheet that launches Print Preview when it's clicked.
Of course... you could use the normal Print function (with keyboard shortcut CTRL + P) for this purpose...
... but the value of this solution is that you can assign any VBA Macro to the Button and quickly run it from a worksheet.
For example, you could run macros to:
- Send off emails
- Show help forms (with documentation for your spreadsheet)
- Run automated reporting processes
... all with the click of a button on your worksheet.
Here we use the .printout method to print the worksheet.
Note: VBA = Visual Basic for Applications (Excel's built-in scripting language)
——
// VIDEO TIMINGS
0:00 - Introduction
0:36 - Viewer Request Explained
1:33 - Overview of 7 steps
3:30 - Step 1 Insert Button (Form Control)
5:15 - Step 2 Set Button property to allow print object
5:31 - Step 3 Insert Printer Icon
6:18 - Step 4 Resize Printer Icon (and change color)
7:17 - Step 5 Group shapes together
8:08 - Step 6 Assign Macro
8:32 - Step 7 Write VBA Code
8:55 - Testing how the Print Button works
——
// DOWNLOAD WORKBOOK FOR THIS TUTORIAL
Please follow these instructions to learn from the workbook download:
▸ Open the workbook and make sure to enable macros
▸ Follow the 7 steps on worksheet "Info" to create your own Print Icon
▸ Press ALT + F11 to open the VBA Editor
▸ Use F8 to step through the code in a subroutine (one line at a time)
▸ I suggest you adapt this to your own needs... just copy and paste the code, then change the code to work for you
▸ If you have a viewer request, leave me a comment below and I'll try to solve your problem in a new video
——
// REFERENCES
Excel Version: 2016 (used in video)
——
// VISIT MY WEBSITE
For more tutorials on Microsoft Excel and VBA visit my website
Connect with me on Social Media
// Recommended Excel Courses //
// Recommended Excel Templates //
If you are looking for pre-built, easy to use spreadsheets, check out Simple Sheets.
They have Excel templates covering cash flow planning, invoices, expense reports, personal budgets, and more!
——
// EPISODE NOTES
In this tutorial video we look at how to set up a Print Button on any Excel worksheet that launches Print Preview when it's clicked.
Of course... you could use the normal Print function (with keyboard shortcut CTRL + P) for this purpose...
... but the value of this solution is that you can assign any VBA Macro to the Button and quickly run it from a worksheet.
For example, you could run macros to:
- Send off emails
- Show help forms (with documentation for your spreadsheet)
- Run automated reporting processes
... all with the click of a button on your worksheet.
Here we use the .printout method to print the worksheet.
Note: VBA = Visual Basic for Applications (Excel's built-in scripting language)
——
// VIDEO TIMINGS
0:00 - Introduction
0:36 - Viewer Request Explained
1:33 - Overview of 7 steps
3:30 - Step 1 Insert Button (Form Control)
5:15 - Step 2 Set Button property to allow print object
5:31 - Step 3 Insert Printer Icon
6:18 - Step 4 Resize Printer Icon (and change color)
7:17 - Step 5 Group shapes together
8:08 - Step 6 Assign Macro
8:32 - Step 7 Write VBA Code
8:55 - Testing how the Print Button works
——
// DOWNLOAD WORKBOOK FOR THIS TUTORIAL
Please follow these instructions to learn from the workbook download:
▸ Open the workbook and make sure to enable macros
▸ Follow the 7 steps on worksheet "Info" to create your own Print Icon
▸ Press ALT + F11 to open the VBA Editor
▸ Use F8 to step through the code in a subroutine (one line at a time)
▸ I suggest you adapt this to your own needs... just copy and paste the code, then change the code to work for you
▸ If you have a viewer request, leave me a comment below and I'll try to solve your problem in a new video
——
// REFERENCES
Excel Version: 2016 (used in video)
——
// VISIT MY WEBSITE
For more tutorials on Microsoft Excel and VBA visit my website
Connect with me on Social Media
Комментарии