+ Reply to Thread
Results 1 to 4 of 4

Copy sheet from closed wkbk to any open book, using VBA that's in personal.xls

  1. #1
    Registered User
    Join Date
    11-25-2011
    Location
    Alaska
    MS-Off Ver
    Excel 2003
    Posts
    42

    Copy sheet from closed wkbk to any open book, using VBA that's in personal.xls

    Hello,

    For some reason this is just kicking my fanny, and sure would welcome some wisdom from the group.

    I have a sheet, called "Durations" in a closed workbook (CertDurations.xls) that resides in a common location on a network drive (S:\ABC\LongTerm\Group One\XYZ). It contains about 300 lines of certification titles and corresponding durations (in years) that each is valid. From time to time the durations change, so I want to leave it in a common location so the code accesses up to date information when it does a vlookup against it. I have another workbook, the output of a data export, that will be open and can be of any name. It will likely be on the user's desktop, but not necessarily. What I can say is that it will be open. The VBA code itself is embedded in each user's personal.xls and linked to a custom button on the toolbar.

    What I want to do is very reliably copy the sheet "Durations" from that workbook "CertDurations.xls" into the open workbook, no matter what the latter's title or location, and then use that data in my vlookup routine. I know there's ways to do this w/o opening "CertDurations.xls", but if it's more reliable, it's ok to open it, I'd just also need to know how to close it.

    Sure could use some help on this one. Thanks much.
    Frank

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Copy sheet from closed wkbk to any open book, using VBA that's in personal.xls

    Frank

    If you want to copy an actual worksheet you can't do it without opening the workbook it's in.

    Do you actually mean you want to copy values from the closed workbook?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    11-25-2011
    Location
    Alaska
    MS-Off Ver
    Excel 2003
    Posts
    42

    Re: Copy sheet from closed wkbk to any open book, using VBA that's in personal.xls

    Sorry, was not precise in my choice of words. What I need to do is copy the values on the sheet "Durations" to the open workbook, regardless of what that opened workbook is named....when the code driving it all is in that particular user's personal.xls.

    Thanks,
    Frank

  4. #4
    Registered User
    Join Date
    11-25-2011
    Location
    Alaska
    MS-Off Ver
    Excel 2003
    Posts
    42

    Re: Copy sheet from closed wkbk to any open book, using VBA that's in personal.xls

    Thanks everyone. I found a workaround ... created a dialog prompting user to do set of things that I know work.

+ 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