+ Reply to Thread
Results 1 to 2 of 2

Placing an "Execute" button in Excel...

Hybrid View

  1. #1
    Registered User
    Join Date
    06-18-2009
    Location
    Pooler, Georgia
    MS-Off Ver
    Excel 2003
    Posts
    2

    Placing an "Execute" button in Excel...

    I have a need to place a button on an Excel spreadsheet that would allow a user to fill in some information, THEN press "Execute" for the spreadsheet to recalculate.

    How is the best way to do this?

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Placing an "Execute" button in Excel...

    Add a button from the Forms toolbar. Assign this macro to it.

    Sub RecalcSheet()
    activesheet.calculate
    End Sub
    If you want the workbook to recalculate you will need to use the following, but it will do all open workbooks.

    Application.Calculate
    Or loop through each worksheet
    Sub RecalcSheet()
       dim shtTemp as worksheet
    
        for each shttemp in activeworkbook.worksheets
            shttemp.calculate
        next
    
    End Sub
    Last edited by Andy Pope; 06-19-2009 at 04:51 AM.
    Cheers
    Andy
    www.andypope.info

+ 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