Sub record()
On Error Resume Next
Dim FLD(10)
Sheets("INPUT").Select
rmax = Range("A" & Rows.Count).End(xlUp).Row
R2 = 1
r = 2
FLD(1) = "NAME: "
FLD(2) = "PS NUMBER: "
FLD(3) = "DIETARY PREFERENCE (halal/vegetarian): "
FLD(4) = "LOCATION: "
While r <= rmax
If Cells(r, 1) <> "" Then
st = Cells(r, 1)
k = 0
j = 0
While j = 0 And k <= 4
j = 0
k = k + 1
j = WorksheetFunction.Find(FLD(k), st)
Wend
If k = 1 Then R2 = R2 + 1
If k < 5 Then
Sheets("output").Cells(R2, k) = Mid(st, j + Len(FLD(k)), Len(st))
End If
End If
r = r + 1
Wend
End Sub
Bookmarks