Command Button In Excel For Mac

Related Articles

  • 1 Print Invoices in a Laser Printer With the Customer Copy
  • 2 Program Printer Settings in Microsoft Access 2007
  • 3 Delete the Printer Queue in Windows
  • 4 Enable Spell Check in MS Office 2007

Millions of small business owners and entrepreneurs all over the world use Microsoft Excel to help with common accounting, forecasting and inventory tasks. With Excel’s integrated tools, it is relatively simple to send a spreadsheet or workbook to someone in an email as attachment. Nevertheless, there are many times when nothing beats a hard copy of spreadsheet data. Of course, you can use the “File Print” menu option on the ribbon bar to create printed versions of your spreadsheet. However, by using Visual Basic for Applications, or VBA, you can also create macros or command buttons to perform various printing tasks within Excel much faster and more efficiently.

Command Button In Excel For Mac

Activate the Developer Tab

1.

Click the worksheet location where you want the upper-left corner of the button to appear. The Assign Macro popup window appears. Assign a macro to the button, and then click OK. To specify the control properties of the button, right-click the button, and then click Format Control. Add a command button (ActiveX control). However, by using Visual Basic for Applications, or VBA, you can also create macros or command buttons to perform various printing tasks within Excel much.

Launch Microsoft Excel and open the workbook or template in which you want to program VBA printing functions. Click “File” on the Excel ribbon, and then “Options.”

2.

Locate and click the “Customize Ribbon” header in the left pane of the 'Excel Options' window. Click the check box next to “Developer” in the Main Tabs section under the 'Customize the Ribbon' label.

3.

Click the “OK” button to activate the 'Developer' tab on the ribbon and close the 'Excel Options' window. After you close the Options window, Excel displays the developer tab on the ribbon bar automatically.

Download now the serial number for Windows 95 Key. All serial numbers are genuine and you can find more results in our database for Windows software. Updates are issued periodically and new results might be added for this applications from our community. Many downloads like Windows 95 Full Version Bootable Iso may also include a crack, serial number, unlock code, cd key or keygen (key generator). If this is the case it is usually found in the full download archive itself. Windows 95 – ISO, Product Key, Installation Steps & Release Date. Being the successor of Windows 3.1, Windows 95 was released by Microsoft as a part of the integrated 9x group with some new and advanced specifications in it. Windows 95 ISO download: Windows 95 free download. Windows 95 was a GUI based operating system which was released by Microsoft in 1995. It was released as a part of the 9x series of the Windows operating system and was the first operating system that was released as a part of the 9x series of Windows operating systems. Windows 8.1 keygen. Windows 95 is an outstanding user-friendly Operating System. This OS is the most reliable and scalable as compared to previous Windows 3.1. Now Windows 95 supports filenames that may include almost 255-characters. It comes with enhanced multimedia capabilities and brings more colors in order to make more interactive to its users.

Create a Print Button with VBA

1.

Click the “Developer” tab on the ribbon. Click the “Insert” icon drop-down arrow in the 'Controls' section of the 'Developer' tab. Click the “Button Control” icon under 'Form Controls.'

2.

Click the cell in the spreadsheet where you want to place a print button. After you click and select a cell, the 'Assign Macro' window appears automatically.

3.

Enter “PrintCurrentSheet” or something similar in the “Macro Name” field. Do not use spaces in the macro name. Click the “New” button. The Visual Basic for Applications editor window appears and displays a new code window.

4.

Tec b sa4g drivers for mac. Place the mouse cursor in the line space between the “Sub PrintCurrentSheet ()” and “End Sub” values. Type the following command:

ActiveSheet.PrintOut

5.

Click the floppy disk icon on the VBA editor toolbar to save the code. Close the VBA editor window.

6.

Right-click the new command button and highlight the default “Button 1” text. Change the button label text to “Quick Print” or another descriptive name.

7.

Click the new command button. Excel prints the active spreadsheet on the default Windows printer without displaying the normal “Print” dialogue box.

Tips

  • You can use the same method to create many print functions in Excel using VBA. Steps for creating the print function button are the same; just the command syntax differs.
  • To print all of the worksheets in the current workbook without displaying the Print dialogue window, replace the “ActiveSheet.PrintOut” command with “Worksheets.PrintOut” or “ActiveWorkbook.PrintOut” – without the quotes.
  • You can create a quick print button for only cells you select with your mouse by using the “Selection.PrintOut” command in the VBA code.
  • If you want to print to a specific printer other than the Windows default, use the following code for the command button in the VBA code window:
  • Sub QuickChangePrinter()
  • Dim sNewPrinter As String
  • sNewPrinter = ActivePrinter
  • ActivePrinter = 'Enter the Windows name of the printer here'
  • Application.PrintOut FileName:='
  • ActivePrinter = sNewPrinter
  • End Sub

References (3)

About the Author

Jeff Grundy has been writing computer-related articles and tutorials since 1995. Since that time, Grundy has written many guides to using various applications that are published on numerous how-to and tutorial sites. Born and raised in South Georgia, Grundy holds a Master of Science degree in mathematics from the Georgia Institute of Technology.

Photo Credits

  • computer mouse image by Photosani from Fotolia.com
Cite this Article
Choose Citation Style
Grundy, Jeff. 'How to Use Excel VBA for Printing.' Small Business - Chron.com, http://smallbusiness.chron.com/use-excel-vba-printing-40832.html. Accessed 15 May 2020.
Grundy, Jeff. (n.d.). How to Use Excel VBA for Printing. Small Business - Chron.com. Retrieved from http://smallbusiness.chron.com/use-excel-vba-printing-40832.html
Grundy, Jeff. 'How to Use Excel VBA for Printing' accessed May 15, 2020. http://smallbusiness.chron.com/use-excel-vba-printing-40832.html
Note: Depending on which text editor you're pasting into, you might have to add the italics to the site name.