+ Reply to Thread
Results 1 to 2 of 2

Copying data where root file changes

  1. #1
    Registered User
    Join Date
    12-12-2014
    Location
    London, England
    MS-Off Ver
    MS Excel 2010
    Posts
    10

    Copying data where root file changes

    Hi

    I need a macro to copy from one sheet to another, however the root file will change every month so is this possible?

    For example –
    Copy data from X:/abc/def/Jan 15/Data/Datafile.xls
    Paste to X:/abc/def/Jan 15/123/123.xls
    The folder “Jan 15” will change every month so when I do it next I will have “Feb 15” however the macro I did for the files in “Jan 15” will no longer be valid for Feb as the root file has changed.

    Any ways round this?

    Hope this makes sense

    Many Thanks.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Copying data where root file changes

    Hi sharp_shooter,

    Yes, there are many ways to do what you want. See the attached file which implements the code that follows. The file has 3 options:
    a. Generate file specifications for the 15th of the current month.
    b. Generate file specifications for the 15th of the previous month.
    c. Generate file specifications for the 15th of a custom month (Jan thru Dec).

    Please let me know if you need additional help, since your question was a little vague.

    Lewis

    Please Login or Register  to view this content.

+ 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. Macro that helps copying filtered data in file A and paste to file B ?
    By achimeda in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-09-2013, 02:14 AM
  2. Replies: 12
    Last Post: 01-01-2013, 02:54 AM
  3. Over writing a file in a root location
    By ngartshore in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-11-2012, 04:25 PM
  4. open file by searching root and sub folders
    By slipperyjim in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-05-2009, 10:42 AM
  5. root file path
    By ashishprem in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2006, 05:20 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