Results 1 to 2 of 2

Combine or vlookup from multiple file to master file

Threaded View

  1. #2
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Combine or vlookup from multiple file to master file

    Here is the Master File with code. You need to update the file Path name in the code

    Sub UpMasFld()
    Dim MasWB, OpnWB As Workbook
    Dim opn, Path, Dir As String
    Dim k As Long
    Dim File As Object
    Dim ms, os As Worksheet
    
    Application.ScreenUpdating = False
    Set MasWB = ThisWorkbook
    Set ms = MasWB.Sheets("Sheet1")
    Path = "C:\Users\m...." 'ThisWorkbook.Path
    opn = ms.[C3].Value
    Dir = Path & "\" & opn & "\"
    [B7:F16].ClearContents
    k = 7
    For Each File In CreateObject("Scripting.filesystemobject").GetFolder(Dir).Files
                Workbooks.Open (Dir & "\" & File.Name)
                Set OpnWB = ActiveWorkbook
                Set os = OpnWB.Sheets(opn)
    
                ms.Cells(k, 2).Value = OpnWB.Name
                ms.Cells(k, 3).Value = os.[B6].Value
                ms.Cells(k, 4).Value = os.[C6].Value
                ms.Cells(k, 5).Value = os.[E6].Value
                ms.Cells(k, 6).Value = os.[F6].Value
                k = k + 1
                Application.DisplayAlerts = False
                    Workbooks(File.Name).Close True
                Application.DisplayAlerts = True
    
    Next
    Application.ScreenUpdating = True
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. how to record file opened status from multiple user files to master file ?
    By prabhuduraraj09 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-07-2018, 10:10 AM
  2. Combine data from multiple files into a master file using VBA
    By bdrod in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-18-2016, 06:00 PM
  3. Replies: 0
    Last Post: 03-04-2013, 03:40 AM
  4. Consolidate Data from Multiple Files (Different File Names) into a Master File
    By dspraveen_23 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-08-2012, 12:59 PM
  5. Macro to combine multiple worksheets into a Master file
    By hazte22 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-15-2012, 04:28 AM
  6. Combine multiple Ecxel files in one master file with VB
    By jelena1290 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-10-2012, 12:36 AM
  7. Rename Multiple Excel Sheets Using Master Vlookup Sheet File
    By avantgti7 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-13-2010, 10:58 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