Well I have been messing with the coding and this is what I have so far:
Sub Test()
Sheets(1).Activate
Sheets(2).Cells.Clear
StudentID = Mid(Cells(1, 1), 4, InStr(Cells(1, 1), "Name:") - 7)
StudentName = Mid(Cells(1, 1), InStr(Cells(1, 1), "Name:") + 6, InStr(Cells(1, 1), "Grade:") - InStr(Cells(1, 1), "Name:") - 7)
StudentGrade = Right(Cells(1, 1), 2)
For N = 4 To Sheets(1).Cells(4, 1).End(xlDown).Row
If IsNumeric(Cells(N, 3)) Then
TargetRow = Sheets(2).Cells(Rows.Count, 1).End(xlUp).Row + 1
Sheets(2).Cells(TargetRow, 1).Value = StudentID
Sheets(2).Cells(TargetRow, 2).Value = StudentName
Sheets(2).Cells(TargetRow, 3).Value = StudentGrade
Sheets(2).Cells(TargetRow, 4).Value = Cells(N, 1).Value
Sheets(2).Cells(TargetRow, 5).Value = Cells(N, 2).Value
Sheets(2).Cells(TargetRow, 6).Value = Cells(N, 3).Value
Sheets(2).Cells(TargetRow, 7).Value = Cells(N, 4).Value
End If
Next N
End Sub
But it is giving me the following:
100110 Acosta, Jacob Z 12 Math 4/26/2010 11 2195
100110 Acosta, Jacob Z 12 Reading 4/26/2010 11 2402
100110 Acosta, Jacob Z 12 Science 4/26/2010 11 2304
100110 Acosta, Jacob Z 12 Social Studies 4/26/2010 11 2404
100110 Acosta, Jacob Z 12 Writing 4/3/2006 7 2399
100110 Acosta, Jacob Z 12
100110 Acosta, Jacob Z 12 Id: 100516 Name: Alanis JR, Julio Cesar Grade: 12
100110 Acosta, Jacob Z 12 State Rpt Id: 637341673 Bldg: 2
As you can see it gives me three extra StudentID and Name for the same student. Then it goes to the next set of data and gives it to me exactly how it looks in the PDF. Not sure what I am doing wrong.
Bookmarks