+ Reply to Thread
Results 1 to 4 of 4

If workbook is open skip

  1. #1
    Forum Contributor
    Join Date
    08-11-2013
    Location
    london
    MS-Off Ver
    Excel 365
    Posts
    270

    If workbook is open skip

    The below is a macro that opens a workbook, it copies an active sheet, opens a workbook (wb Target) and then pastes to the workbook that was just opened.

    I have a few active sheets i would like to copy and paste

    As the opened workbook (wb Target) wasnt closed, how would i get it to just copy and paste without reopening to same workbook?


    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Below is the next step

    Please Login or Register  to view this content.

  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: If workbook is open skip

    This is how I would do that:

    Please Login or Register  to view this content.
    _________________
    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!)

  3. #3
    Forum Contributor
    Join Date
    08-11-2013
    Location
    london
    MS-Off Ver
    Excel 365
    Posts
    270

    Re: If workbook is open skip

    Thank you for this, can i ask what wsSRC stands for?

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

    Re: If workbook is open skip

    I invent my variables at the beginning then use then all through the code. It saves time. This way if I need to change the name of something, in this case then name of the "Source worksheet", I only change it in one place at the top and all the remaining code stays the same.

+ 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. How to skip rows when referencing another workbook that doesn't skip rows?
    By Julian2501 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-06-2014, 04:55 PM
  2. Skip The Read Only Prompt When I Open A File - Excel, Open it read-write instead.
    By harry_1805 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-06-2012, 02:14 AM
  3. Save an open workbook, then open template workbook and close the saved workbook
    By ondvirg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2009, 10:20 PM
  4. [SOLVED] How to skip files which are open?
    By Jan Nademlejnsky in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-21-2006, 11:45 PM
  5. Open files in folder - skip if already open
    By Steph in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-25-2005, 03:06 PM

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