+ Reply to Thread
Results 1 to 5 of 5

Making sure one workbook is on top

  1. #1
    Registered User
    Join Date
    06-04-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    53

    Making sure one workbook is on top

    Hi Guys,

    I need some help on what is probably a minor point any help would be greatly appreciated.

    I run a process that collects data and stores it every 20 minutes. For historical reasons the way the process is set up I need to have 2 workbooks open at the same time.

    WorkBook1 stores the data every 20 minutes and has the macros assigned to it while Workbook2 receives the data. If (accidentally) WorkBook2 is on top when the 20 minute macro runs to store the data in WorkBook1 then the whole data process breaks down and I have to manually reset it. Leading to mucho frustration.

    Is there a VBA command that I can place at the start of the 20 minute macro that will force WorkBook1 on top if WorkBook2 happens to be on top before the 20 minute macro operates?

    Thanks in advance,
    Last edited by AliJay; 03-02-2015 at 07:25 AM.

  2. #2
    Registered User
    Join Date
    09-10-2014
    Location
    Matrix
    MS-Off Ver
    2010
    Posts
    70

    Re: Making sure one workbook is on top

    Try this:
    Please Login or Register  to view this content.
    Last edited by michson; 03-02-2015 at 06:11 AM.
    (*) Reputation points appreciated.
    excelbs.tk

  3. #3
    Registered User
    Join Date
    06-04-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Making sure one workbook is on top

    Thanks so much for that Michson. So in my example I would substitute "FirstWB" as "WorkSheet1" and it should work?

  4. #4
    Registered User
    Join Date
    09-10-2014
    Location
    Matrix
    MS-Off Ver
    2010
    Posts
    70

    Re: Making sure one workbook is on top

    AliJay, you were talking about workbook. So there should be your Workbook name.

  5. #5
    Registered User
    Join Date
    06-04-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Making sure one workbook is on top

    Thanks again mate...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Making backup copy of active workbook while workbook is open
    By Bezzie in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-01-2014, 06:06 AM
  2. Making VBA function available to any workbook
    By krabople in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-09-2008, 08:48 AM
  3. making a workbook
    By punkiegirl420 in forum Excel General
    Replies: 3
    Last Post: 10-29-2006, 06:34 PM
  4. making one workbook out of two
    By grantr in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-07-2005, 11:24 AM
  5. Making sense of a workbook
    By SandyUK in forum Excel General
    Replies: 2
    Last Post: 03-14-2005, 05:10 AM

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