I have a client who has sent me an alpha file of what he is looking for, but I have never created command buttons and do not know how to go about it. He wants two command buttons at the bottom of his spreadsheet; if you click one it will print the spreadsheet and if you click the other button it will send the spreadsheet via Outlook e-mail. Any help would be greatly appreciated.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Command Buttons (Excel 2003)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Command Buttons (Excel 2003)
- This topic has 6 replies, 2 voices, and was last updated 17 years, 4 months ago.
Viewing 0 reply threadsAuthorReplies-
WSHansV
AskWoody LoungerJanuary 20, 2008 at 10:25 pm #1093401“At the bottom of his spreadsheet” is a vague notion – if you scroll up or down, the command buttons will move around.
What does the client want the second button to do – open a new e-mail with the workbook attached (so that the user can fill in the recipient etc.), or send the workbook to a fixed recipient without intervention by the user?
-
WScabratt
AskWoody LoungerJanuary 20, 2008 at 10:44 pm #1093403Hi Hans,
Thanks for your speedy response. The client has sent me an alpha file of what he wants. Basically it looks to be a spreadsheet with four columns, the first column is labeled Document and below that there are several documents listed with a check box next to them. The next column is labeled Quantity. The client wants to be able to click the checkbox under Document and that would enable him to enter a quantity in the next column and the third column is labeled Unit price and the fourth column is labeled Line price. There are thirteen documents listed with check boxes and a cell at the end of the Line price column for the Total Project Cost.Beneath all of that (two rows down) is a cell for the date, one for a P.O./Reference and a command button to click to print the document and the other command button to click and send the document to a fixed e-mail address. This may be a bit over my head, but I would like to give it a try if you can help me out.
Thank you so much for your time and effort!
-
WSHansV
AskWoody LoungerJanuary 20, 2008 at 11:16 pm #1093405You could do the following:
– Select View | Toolbars | Control Toolbox. You’ll see a new toolbar.
– Click on the Command Button button on the Control Toolbox.
– Click on the worksheet where you want the first command button.
– Excel will automatically turn on Design Mode.
– Double click the new command button.
– This will activate the Visual Basic Editor and create the first and last lines of the code to be executed by the button.
– Press Tab, then type the following instruction:
ActiveSheet.PrintOut
– The so-called event procedure should now look like this:
Private Sub CommandButton1_Click()
ActiveSheet.PrintOut
End Sub
– On the left hand side, you should see the Properties pane for the command button. If not, select View | Properties.
– Change the Caption property to Print Sheet or something similar.
– Press Alt+F11 to return to Excel.– Click on the Command Button button on the Control Toolbox again.
– Click on the worksheet where you want the first command button.
– Double click the new command button.
– Press Tab, then type the following instruction:
ActiveWorkbook.SendMail Recipients:="someone@somewhere.com", Subject:="Invoice"
– Change someone@somewhere.com to the correct e-mail address, and Invoice to the appropriate subject.
– Note: you may initially want to use your own e-mail address for testing purposes.
– The so-called event procedure should now look like this:
Private Sub CommandButton2_Click()
ActiveWorkbook.SendMail Recipients:="someone@somewhere.com", Subject:="Invoice"
End Sub
– Change the Caption property to E-mail workbook or something similar.
– Press Alt+F11 to return to Excel.
– Click the first button on the Control Toolbox to turn off Design Mode.
– The buttons should now work.
-
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Win 11 24H2 June 2025 Update breaks WIFI
by
dportenlanger
3 hours, 28 minutes ago -
Update from WinPro 10 v. 1511 on T460p?
by
CatoRenasci
45 minutes ago -
System Restore and Updates Paused
by
veteran
5 hours, 58 minutes ago -
Windows 10/11 clock app
by
Kathy Stevens
29 seconds ago -
Turn off right-click draw
by
Charles Billow
9 hours, 12 minutes ago -
Introducing ChromeOS M137 to The Stable Channel
by
Alex5723
12 hours, 43 minutes ago -
Brian Wilson (The Beach Boys) R.I.P
by
Alex5723
1 hour, 46 minutes ago -
Master patch listing for June 10, 2025
by
Susan Bradley
14 hours, 20 minutes ago -
Suggestions for New All in One Printer and a Photo Printer Windows 10
by
Win7and10
6 hours, 22 minutes ago -
Purchasing New Printer. Uninstall old Printer Software First?
by
Win7and10
20 hours, 21 minutes ago -
KB5060842 Issue (Minor)
by
AC641
1 day ago -
EchoLeak : Zero Click M365 Copilot leak sensitive information
by
Alex5723
1 day, 3 hours ago -
24H2 may not be offered June updates
by
Susan Bradley
2 hours, 4 minutes ago -
Acronis : Tracking Chaos RAT’s evolution (Windows, Linux)
by
Alex5723
1 day, 16 hours ago -
June 2025 updates are out
by
Susan Bradley
4 hours, 18 minutes ago -
Mozilla shutting Deep Fake Detector
by
Alex5723
2 days, 6 hours ago -
Windows-Maintenance-Tool (.bat)
by
Alex5723
1 day, 16 hours ago -
Windows 11 Insider Preview build 26200.5641 released to DEV
by
joep517
2 days, 9 hours ago -
Windows 11 Insider Preview build 26120.4250 (24H2) released to BETA
by
joep517
2 days, 9 hours ago -
Install Office 365 Outlook classic on new Win11 machine
by
WSrcull999
2 days, 9 hours ago -
win 10 to win 11 with cpu/mb replacement
by
aquatarkus
2 days, 1 hour ago -
re-install Windows Security
by
CWBillow
2 days, 12 hours ago -
WWDC 2025 Recap: All of Apple’s NEW Features in 10 Minutes!
by
Alex5723
2 days, 16 hours ago -
macOS Tahoe 26
by
Alex5723
2 days, 10 hours ago -
Migrating from win10 to win11, instructions coming?
by
astro46
1 hour, 10 minutes ago -
Device Eligibility for Apple 2026 Operating Systems due this Fall
by
PKCano
2 days, 1 hour ago -
Recommended watching : Mountainhead movie
by
Alex5723
2 days, 1 hour ago -
End of support for Windows 10
by
Old enough to know better
35 minutes ago -
What goes on inside an LLM
by
Michael Covington
1 hour, 31 minutes ago -
The risk of remote access
by
Susan Bradley
35 minutes ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.