Results 1 to 8 of 8

Compiling Data from Multiple Stardardized Excel Files into ONE Excel Master File

Threaded View

akurdi Compiling Data from Multiple... 01-03-2013, 08:09 PM
winch Re: Compiling Data from... 01-03-2013, 09:17 PM
xladept Re: Compiling Data from... 01-03-2013, 09:30 PM
akurdi Re: Compiling Data from... 01-04-2013, 08:35 AM
xladept Re: Compiling Data from... 01-04-2013, 03:21 PM
xladept Re: Compiling Data from... 01-04-2013, 03:45 PM
akurdi Re: Compiling Data from... 01-04-2013, 04:12 PM
xladept Re: Compiling Data from... 01-04-2013, 05:06 PM
  1. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Compiling Data from Multiple Stardardized Excel Files into ONE Excel Master File

    To run the routine you need the Oral Communication Rubric "up" - I guess that you inserted a Worksheet, or it wouldn't have run at all. But is it one book one rubric and are the Worksheets all named "Oral Communications Rubric"??? - I'll proceed on that assumption; with a technique known as "running the directory".

    This is set up so that the book that you're collecting the data in is in the same folder as the others and has a worksheet named "Sheet1"

    Sub Akurdi(): Dim wb As Workbook, ws As Worksheet, wd As Worksheet, N As String
    Dim i As Integer, j As Integer, r As Long: j = 0
    Dim Name As String, ID As String, Major As String, Course As String, Section As Integer
    Dim Term As Integer, PType As String, PForm As String, PDate As Date, No(15) As Integer
    Dim S As String, P As String, U As String: P = ActiveWorkbook.Path & "\": U = Dir(P)
    
    Set ws = ActiveWorkbook.Worksheets("Sheet1"): N = ActiveWorkbook.Name
    With ws
    .Cells(1, 1) = "Name": .Cells(1, 2) = "ID": .Cells(1, 3) = "Major"
    .Cells(1, 4) = "Course": .Cells(1, 5) = "Section": .Cells(1, 6) = "Term"
    .Cells(1, 7) = "PType": .Cells(1, 8) = "PForm": .Cells(1, 9) = "PDate"
    For i = 1 To 14: .Cells(1, i + 9) = "No. " & i: Next i
    End With
    
    SetNextBook:
    If U = N Then GoTo GetNextBook  'you don't need this line unless you're not using one of the source books
    
    Workbooks.Open fileName:=P & U
        Set wb = ActiveWorkbook: Set wd = wb.Worksheets("Oral Communications Rubric")
    With wd
    Name = .Cells(11, 3): ID = .Cells(12, 3): Major = .Cells(13, 3)
    Course = .Cells(14, 3): Section = .Cells(15, 3): Term = .Cells(16, 3)
    PType = .Cells(17, 3): PForm = .Cells(18, 3): PDate = .Cells(19, 3)
    For i = 22 To 61 Step 3: j = j + 1: No(j) = .Cells(i, 5): Next i
    End With
    
    With ws
    r = .Range("A" & Rows.Count).End(xlUp).row + 1
    .Cells(r, 1) = Name: .Cells(r, 2) = ID: .Cells(r, 3) = Major
    .Cells(r, 4) = Course: .Cells(r, 5) = Section: .Cells(r, 6) = Term
    .Cells(r, 7) = PType: .Cells(r, 8) = PForm: .Cells(r, 9) = PDate
    For i = 1 To 14: .Cells(r, i + 9) = No(i): Next i
    End With
                wb.Close SaveChanges:=False
    GetNextBook:
    U = Dir(): GoTo SetNextBook
    EndSub: End Sub
    Last edited by xladept; 01-04-2013 at 03:58 PM.

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