I'm trying to take a text document that has data in paragraphs (job descriptions) and put it into a spreadsheet, shifting various pieces of text into Excel columns. Each paragraph has certain characteristics that I THINK would allow me to identify the different elements (Title, Salary, Description, Hours, etc.). For example, Title is always underlined.
So I started writing a subroutine to find the underlined words, but it craps out:
Sub SearchCellFormat()
' Establish search criteria.
With Application.FindFormat.Font
.Underline = xlUnderlineStyleSingle
End With
' Find the cells based on the search criteria.
Cells.Find(What:="", After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=True).Activate
End Sub
Even if only a crude start, is this the way to go about parsing text?
Sample text:
START SAMPLE
Admin Dir Cardiology Services Starting Salary: Admin
Description: Responsible for managing...
Department: Cardiology. Location: Medical Center Campus. Hrs per week: 40. Shift: Day. Hours: 8:00am-4:30pm.
END SAMPLE
Though you can't see it here, "Admin Dir Cardiology Services" is underlined. Nothing else is. All the other elements are preceded by their names, which should be handy.
Any thoughts appreciated!
Lauri
So I started writing a subroutine to find the underlined words, but it craps out:
Sub SearchCellFormat()
' Establish search criteria.
With Application.FindFormat.Font
.Underline = xlUnderlineStyleSingle
End With
' Find the cells based on the search criteria.
Cells.Find(What:="", After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=True).Activate
End Sub
Even if only a crude start, is this the way to go about parsing text?
Sample text:
START SAMPLE
Admin Dir Cardiology Services Starting Salary: Admin
Description: Responsible for managing...
Department: Cardiology. Location: Medical Center Campus. Hrs per week: 40. Shift: Day. Hours: 8:00am-4:30pm.
END SAMPLE
Though you can't see it here, "Admin Dir Cardiology Services" is underlined. Nothing else is. All the other elements are preceded by their names, which should be handy.
Any thoughts appreciated!
Lauri