+ Reply to Thread
Results 1 to 4 of 4

Macro to copy from xls( variable filename) to static xls filename

  1. #1
    Registered User
    Join Date
    07-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Macro to copy from xls( variable filename) to static xls filename

    Hello,
    I am attempting to copy data from various cells( not contigeous) in an xls file with a variable name to another xls file with a static filename. The cells i wish to copy from are all over the place ie. I10,J12,D12,D10 etc, etc. Although these cells remain constant in each xls file with a variable filename.
    I wish to paste these cells in the file ( static filename) in A2,B2,C2 etc,etc .

    The next time the xls file ( variable filename) is opened I wish to paste the contents of the same cells I10,J12,D12,D10 to the next available line free in the xls file ( static filename).
    any and all help appreciated.

  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: Macro to copy from xls( variable filename) to static xls filename

    Are these variable files all in the same folder? Do you wish to just have the macro open all the files in a specific folder and import these values?
    _________________
    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
    Registered User
    Join Date
    07-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Macro to copy from xls( variable filename) to static xls filename

    Yes these variable files will be in the same folder as the static named file.
    The variable xls filename will be FTP'd in from a firewalled server, its the only way we can get the file out, once out it will populate in the same folder as the static named xls file. the FTP process may be run several times and therefore each iteration of the xls file will have a different filename.eg. IRF1234,IRF1235,IRF1236 etc etc. Also the desifgnation may change to LSPF****,LSPF***2,LSPF***3, etc and finally POF***1,POF***2 etc.

    Thanks for your reply

  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: Macro to copy from xls( variable filename) to static xls filename

    ok, after the STATIC file imports the variable info files, should they be archived into another folder to preclude accidental reimportation? Assuming so... Here's a macro for collecting data from all files in a specific folder.The parts of the code that need to be edited are colored on that web page to draw your attention.

    The published macro imports ALL the data, so this part:
    Please Login or Register  to view this content.
    ...would be changed to this for your scenario:
    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)

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