+ Reply to Thread
Results 1 to 3 of 3

Problem with macro/vba - Want to bring page to front?

  1. #1
    Registered User
    Join Date
    11-28-2012
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    8

    Problem with macro/vba - Want to bring page to front?

    Hi guys

    I have the following macro which basiclly acts as a refresh button on a read only sheet:
    Please Login or Register  to view this content.
    The sheet is read only as it is used by many people and it prevents them damaging the sheet. The sheet is updated regularly and as many people who use the sheet have little excel knowledge a refresh button was required. The macro is attached to a button that when clicked, it closes the sheet, then reopens it meaning any updates I add to the sheet can then be seen by everyone else once they click the button - much like 'Refresh'.

    So, the code above works fine. Click the button, the sheet closes, 5 seconds later reopens. However, when the sheet reopens, any other excel sheets that are open seem to be at the front and the sheet that has been 'reopened' is behind them. Is there anything I can do to make the macro not only close and reopen the sheet, but when it does reopen, bring it to the front so that it is visible straight away without having to click Window and then select the appropriate sheet?

    Hope this all makes sense. Any help with this would be much appreciated.

    EDIT: Just tried this on my computer at home (Excel 2010) and it doesnt seem to be an issue.. Unfortunately we use a much older version at work and it will automatically open all excel sheets in one instance of exce hence i need to macro to bring the sheet to the from after reopening.l.
    Last edited by Wanting2Excel; 02-18-2013 at 06:21 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Problem with macro/vba - Want to bring page to front?

    Hi,

    Put
    ThisWorkbook.Activate

    inside the OpenMe procedure.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    11-28-2012
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Problem with macro/vba - Want to bring page to front?

    ah..so simple. Thanks. I guess ill have to try this tomorrow back at work. Thanks very much!

+ 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