+ Reply to Thread
Results 1 to 2 of 2

Adding a button into a sheet

  1. #1
    Registered User
    Join Date
    04-15-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    34

    Adding a button into a sheet

    Hello Everyone,

    I have seen in some spread sheets the inclusion of a button into the sheet itself. When clicked, I assume that the click activates a macro, but I am not sure if it is actually a macro.

    How can I go about adding one of these into my sheet?

    The sequence that I would like to follow the buttom click is pretty simple (and i am not sure how to do any of it):

    -a popup message the user saying the "current cell selected is <cell ref>, click ok if correct, cancel to cancel process" where the cancel button stops the macro.
    -simply copy and paste values for the set cells

    thats it...

    If anyone can help, that would be great.

    Ste

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Adding a button into a sheet

    Hi Ste_Mulv.

    1) A macro to remove formulas from any/all cells currently selected. This will work if one cell is selected, a range cellls, or random non-contiguous cells, it will still work. No matter how many cells are selected, it will ask for permission (and name the cells) to do it.
    Please Login or Register  to view this content.
    Install the macro:
    A. Open up your workbook
    B. Get into VB Editor (Press Alt+F11)
    C. Insert a new module (Insert > Module)
    D. Copy and Paste in your code (given above)
    E. Get out of VBA (Press Alt+Q)
    F. Save your sheet

    The macro is installed and ready to use. You can press Alt-F8 and select it from the macro list, or:
    ========

    2) Add a button to your sheet for the macro.

    A) Make sure the Forms Toolbar is visible.
    B) Click on the Button icon
    C) Draw your button on your sheet
    D) The Assign Macro window will appear...select the RemoveFormula macro we added earlier
    E) Click OK
    F) Click on the button text and change the caption to whatever you wish it to be.
    G) Click on a blank cell to unhighlight the button (this makes it active)

    ========
    You can now select as many cells/ranges you want, then click your macro button.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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