+ Reply to Thread
Results 1 to 5 of 5

Merging multiple workbook values instead of formulas

  1. #1
    Registered User
    Join Date
    05-04-2015
    Location
    Illinois, US
    MS-Off Ver
    2007
    Posts
    3

    Merging multiple workbook values instead of formulas

    I am trying to merge a summary worksheet from multiple workbooks together. The summary sheet is comprised of formulas reading from other datasheets.

    I found this code and have it working to read and copy the correct parts of the sheet, but I can't figure out how to get it to read and copy the values instead of the formula.

    Sub LoopThroughOLDDirectory()


    Dim MyFile As String, rng As Range, wb As Workbook, i As Long, j As Long
    MyFile = Dir("O:\LAP Project\l*")
    Do While Len(MyFile) > 0
    If MyFile = "zmaster.xlsm" Then
    Exit Sub
    End If
    Set wb = Workbooks.Open(MyFile)
    With wb.Sheets(4)
    rngArr = Array("$C$2", "$D$2", "$E$2", "$F$2", "$C$3", "$D$3", "$E$3", "$F$3", "$C$4", "$D$4", "$E$4", "$F$4")
    j = 0
    For i = LBound(rngArr) To UBound(rngArr)
    j = j + 1
    .Range(rngArr(i)).Copy Workbooks("zmaster.xlsm").Sheets(1).Cells(Rows.Count, j).End(xlUp)(2)
    Next
    End With
    wb.Close
    MyFile = Dir
    Loop
    End Sub

    Help would be appreciated.

    Thanks,
    Angie
    Last edited by angminer; 07-31-2015 at 10:45 AM.

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Merging multiple workbook values instead of formulas

    Try this untested code
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Merging multiple workbook values instead of formulas

    You could try moving the paste to the next line so you can invoke the PasteValues method.

    Please Login or Register  to view this content.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Merging multiple workbook values instead of formulas

    Please use code tags when posting to the Forum. Refer to Rule 3 in the link.

    http://www.excelforum.com/forum-rule...rum-rules.html

    Maybe change this line:

    Please Login or Register  to view this content.
    To:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-04-2015
    Location
    Illinois, US
    MS-Off Ver
    2007
    Posts
    3

    Re: Merging multiple workbook values instead of formulas

    Thank you for all of your help! I was hoping it was something simple.

    Both methods work perfectly.

+ 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. Merging data from multiple workbook shortcuts from some but not all worksheets
    By 22497 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-10-2014, 06:02 PM
  2. Replies: 2
    Last Post: 07-12-2013, 02:34 AM
  3. [SOLVED] Merging multiple spreadsheets into one workbook?
    By Oszie in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-27-2013, 07:42 PM
  4. Merging multiple workbooks on to one master workbook
    By inkandpaint in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-15-2012, 01:22 PM
  5. Merging Multiple Worksheets into one Mastersheet within same workbook
    By kim5012 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-20-2012, 04:44 PM
  6. Split one workbook into multiple ones and merging them back into one?
    By Jermin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-24-2010, 07:29 AM
  7. Replies: 2
    Last Post: 05-26-2006, 01:35 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