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
-
A CVE-MITRE-CISA-CNA Extravaganza
by
Nibbled To Death By Ducks
4 hours, 51 minutes ago -
Sometimes I wonder about these bots
by
Susan Bradley
1 hour, 9 minutes ago -
Does windows update component store “self heal”?
by
Mike Cross
17 hours, 48 minutes ago -
Windows 11 Insider Preview build 27858 released to Canary
by
joep517
18 hours, 48 minutes ago -
Pwn2Own Berlin 2025: Day One Results
by
Alex5723
18 hours, 14 minutes ago -
Windows 10 might repeatedly display the BitLocker recovery screen at startup
by
Susan Bradley
14 hours, 44 minutes ago -
Windows 11 Insider Preview Build 22631.5409 (23H2) released to Release Preview
by
joep517
21 hours, 30 minutes ago -
Windows 10 Build 19045.5912 (22H2) to Release Preview Channel
by
joep517
21 hours, 32 minutes ago -
Kevin Beaumont on Microsoft Recall
by
Susan Bradley
10 hours, 6 minutes ago -
The Surface Laptop Studio 2 is no longer being manufactured
by
Alex5723
1 day, 5 hours ago -
0Patch, where to begin
by
cassel23
23 hours, 41 minutes ago -
CFPB Quietly Kills Rule to Shield Americans From Data Brokers
by
Alex5723
1 day, 19 hours ago -
89 million Steam account details just got leaked,
by
Alex5723
1 day, 7 hours ago -
KB5058405: Linux – Windows dual boot SBAT bug, resolved with May 2025 update
by
Alex5723
2 days, 3 hours ago -
A Validation (were one needed) of Prudent Patching
by
Nibbled To Death By Ducks
1 day, 18 hours ago -
Master Patch Listing for May 13, 2025
by
Susan Bradley
1 day, 5 hours ago -
Installer program can’t read my registry
by
Peobody
2 hours, 54 minutes ago -
How to keep Outlook (new) in off position for Windows 11
by
EspressoWillie
1 day, 16 hours ago -
Intel : CVE-2024-45332, CVE-2024-43420, CVE-2025-20623
by
Alex5723
1 day, 23 hours ago -
False error message from eMClient
by
WSSebastian42
2 days, 14 hours ago -
Awoke to a rebooted Mac (crashed?)
by
rebop2020
3 days ago -
Office 2021 Perpetual for Mac
by
rebop2020
3 days, 1 hour ago -
AutoSave is for Microsoft, not for you
by
Will Fastie
3 hours, 49 minutes ago -
Difface : Reconstruction of 3D Human Facial Images from DNA Sequence
by
Alex5723
3 days, 4 hours ago -
Seven things we learned from WhatsApp vs. NSO Group spyware lawsuit
by
Alex5723
12 hours, 12 minutes ago -
Outdated Laptop
by
jdamkeene
3 days, 10 hours ago -
Updating Keepass2Android
by
CBFPD-Chief115
3 days, 15 hours ago -
Another big Microsoft layoff
by
Charlie
3 days, 15 hours ago -
PowerShell to detect NPU – Testers Needed
by
RetiredGeek
17 hours, 25 minutes ago -
May 2025 updates are out
by
Susan Bradley
39 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.