Results 1 to 6 of 6

Consolidating data from different workbooks

Threaded View

  1. #1
    Registered User
    Join Date
    11-18-2008
    Location
    Pune
    Posts
    11

    Consolidating data from different workbooks

    How can I consolidate data from n no. of workbooks (with similar format) into one worksheet? There can be any no of workbook present at any given point of time and the macro should be able to count the number of files available in the folder and run loop accordingly.

    I was trying the following logic but it didnt work.
    Sub collate()
    Dim wb As Workbook
    Dim sht As Object
    Dim i As Integer
    Dim str As String
    
    Application.ScreenUpdating = False
    
    str = Dir("D:\Feedback\" & "*.xls")
    
    Set wb = Workbooks(str)
    
    i = 1
    
    Do While Len(str) > 4
    Loop
    ThisWorkbook.Sheets("Day1").Range("A2").Value = wb.Sheets("Day1feedback").Range("j2").Value
    i = i + 1
    End
    
    End Sub
    Last edited by Leith Ross; 11-18-2008 at 01:33 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