Results 1 to 9 of 9

How to copy values from one OPEN workbook (with variable file name) to another

Threaded View

  1. #1
    Registered User
    Join Date
    01-25-2013
    Location
    Slovakia
    MS-Off Ver
    Excel 2011 Mac
    Posts
    7

    Question How to copy values from one OPEN workbook (with variable file name) to another

    Hello there :-)

    Every month I receive a batch of new files with names such as Analysis_Report_0001, 0002, 0003 etc. The Analysis_Report string is always there but the numbers are changing - you get the idea.

    Then I have a file Analysis Summary where I need to input certain values from the Analysis_Report files.

    Here's the code that works (I have both files already open and the macro is in the Analysis Summary file).

     Sub Macro1()
    '
    ' Macro1 Macro
    '
    
    '   Windows("Analysis_Report_0001.xlsx").Activate 
        Range("Q3:Q10").Select
        Selection.Copy
        Windows("Analyses Summary.xls").Activate
        Range("C2").Select
        Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
            False, Transpose:=False
        Application.CutCopyMode = False
    
    End Sub
    What I need to do is to have a macro nested in the Analysis Summary file, that would activate any OPEN workbook that contains the "Analysis_Report" string in its file name, copy the selected range, and paste values to the first empty cell in the column C.

    Now, I don't need the macro to open the Analysis Report file, as I already have it open, and I need to do without references to C: stuff - the path would change every month anyway.

    I've spent the last two days comming out with a solution, and I'm going gray by now :-)

    Any help will be much appreciated.
    Last edited by Kitko; 01-25-2013 at 08:50 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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