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
Bookmarks