+ Reply to Thread
Results 1 to 3 of 3

Adding Buttons to the Worksheet

  1. #1
    Registered User
    Join Date
    10-05-2007
    Posts
    2

    Smile Adding Buttons to the Worksheet

    Hi, 1st post.

    Basically what I want is a simple macro that when I click my macro "Yes" button in column D2, I want to appear in column E2 "Pass" and visa versa for No and Fail. This is for a test script I am compliling.

    I have done macro coding at college but alas the simple things I seem to have forgotten.


    Thanks.


    P.S This is for Excel 2003 Professional

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello TheFunkyGibbon,

    Adding Buttons to the Worksheet
    1. Click View on the Excel Menu Bar or use ALT+V.
    2. Click Toolbars or type T to display the available toolbars.
    3. Click on Forms or use the Down Arrow to select this toolbar.
    4. Look for the rectangular icon. When you place the mouse on it you will see Button displayed.
    5. Click on this icon.
    6. Move the cursor to the cell where you want the button. Left Click and Hold the button down while you move the mouse. This will draw the button. Release the button when you are done.
    7. A dialog box will appear asking you to assign a macro. Close the dialog. The macro will be added later.
    8. Repeat steps from 4 on to add more buttons.

    Macro Code
    Change the cells addresses in the quotes to what you want.
    Please Login or Register  to view this content.
    1. Copy the macro above pressing the keys CTRL+C
    2. Open your workbook
    3. Right Click on any Sheet's tab
    4. Left Click on View Code in the pop up menu
    5. Press the keys ALT+I to activate the Insert menu
    6. Press M to insert a Standard Module
    7. Paste the code by pressing the keys CTRL+V
    8. Make any custom changes you need to the macro
    9. Save the Macro by pressing the keys CTRL+S

    Assign the Macros to the Buttons
    1. Right Click the Button. A pop up menu will appear.
    2. Near the bottom, click on Assign Macro...
    3. A dialog will appear with a list of macros. Select Macro1, and click OK.
    4. Do the same for the second button using [b]Macro2[b].
    To change the Button's caption. select the button and Right Click it. Select Edit Text, highlight the text, and type what you want the button to display.

    Sincerely,
    Leith Ross
    Last edited by Leith Ross; 10-05-2007 at 03:59 PM.

  3. #3
    Registered User
    Join Date
    10-05-2007
    Posts
    2
    Thank you very much, I have saved the code and will try to remember this time around

    Take care



    -Adam

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1