+ Reply to Thread
Results 1 to 4 of 4

Macro to Open File & Copy Data

  1. #1
    Registered User
    Join Date
    08-19-2004
    Posts
    60

    Macro to Open File & Copy Data

    Hi

    I've got a workbook which i want a macro on it, which needs to do the following:

    1. Open a specific file (with a dialog box to choose the file if possible)
    2. Refresh all of the data in the newly opened workbook (there are 90+ sheets with external data on them)
    3. Go to the master sheet in this workbook and select a range and copy it.
    4. Return to the original workbook and paste the data.
    5. Close the workbook that we opened and save the changes.

    The workbook i have is too big to post here, however if someone could show me the basics of the VBA that would be created from this, i think i could edit it to fir what i want to do.

    Thanks

    James

  2. #2
    Registered User
    Join Date
    08-19-2004
    Posts
    60
    Hi,
    any ideas anyone?

    James

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    This code will enable you to select a workbook to open & refresh the queries. You will need to give more precise details for the ranges

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    08-19-2004
    Posts
    60
    Hi,

    Cheers for that, i'll go into more detail now, what i want to do is:

    1. Open a file (selected by the user)
    2. Refresh all of the external data
    2. Select the range A2:J9201
    3. Copy the range
    4. Paste the range (values only) to cells A2:J9201 in a tab called "COMBI" in the original workbook
    5. Close the user-chosen workbook (saving changes)

    James

+ 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