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

Описание к видео 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"
→ https://www.launchexcel.com/record-yo...

// Recommended Excel Courses //

1. Launch Excel Macros & VBA School: https://go.launchexcel.com/macros-vba...
2. Excel Campus Elevate Program: https://go.launchexcel.com/excel-camp...
3. My Online Training Hub Dashboards: https://go.launchexcel.com/moth-dashb...
4. Coursera Excel Specialisation: https://go.launchexcel.com/coursera-e...
5. Coursera Everyday Excel: https://go.launchexcel.com/coursera-e...
6. Coursera Excel Data Visualisation: https://go.launchexcel.com/coursera-d...

// Recommended Excel Templates //

If you are looking for pre-built, easy to use spreadsheets, check out Simple Sheets.
https://go.launchexcel.com/simple-she...

They have Excel templates covering cash flow planning, invoices, expense reports, personal budgets, and more!

DOWNLOAD WORKBOOK → https://www.launchexcel.com/media/sam...

——
// 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:

▸ Download the sample Excel workbook: https://www.launchexcel.com/media/sam...

▸ 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
→ https://www.launchexcel.com

Connect with me on Social Media
→   / victorchan_  

Комментарии

Информация по комментариям в разработке