Job Recruitment Website - Job information - How to extract the information of 1000 into Excel?
How to extract the information of 1000 into Excel?
WORD file is a report which contains everyone's information. How to extract names, phone numbers, ID numbers and home addresses from multiple files into EXCL for statistical analysis? Because there are too many files, I hope everyone can help me give an efficient way! Thanks in advance!
The general structure is as follows:
Subabstract ()
range(" a 1 ")current region . offset( 1,0)。 Clear content
Cells. Borders.LineStyle = xlNone
Apply. ScreenUpdating = False
Dim Word as Word. document
Dim wordapp as an object
Dim cPath$,cFile$,i%,arr()
cPath = ThisWorkbook。 Path and path. "\"
cFile = Dir(cPath & amp; "*. Doc? ”)
Set wordapp = CreateObject("word. Application ")
Do While cFile & lt& gt""
Set wordD = wordapp. Documents. Open (cPath & ampcFile)
i = i + 1
ReDim Preserve arr( 1 to 4, 1 to I)
Use wordD.tables(4)
Arr( 1, i) = Trim(Replace (. Cell(2, 1).Range.Text,Chr(7),""),Chr( 13),""))
Arr(3, i) = Trim(Replace (. Cell(2,3).Range.Text,Chr(7),""),Chr( 13),""))
End with ...
With wordD
Arr(2, i) = Trim(Replace (. Form (3) Cell(2,4).Range.Text,Chr(7),""),Chr( 13),""))
Arr(4, i) = Trim(Replace (. Form (5) Cell(2,2).Range.Text,Chr(7),""),Chr( 13),""))
End with ...
wordD。 close
cFile = Dir
ring
Set wordD = Nothing.
wordapp。 give up
Range ("a2"). Adjust the size (I, 4). Value = application. transposition
Scope ("a1:d"&; I+ 1). borders . line style = XL continuous
Apply. ScreenUpdating = True
End joint
Great God, if there are several documents with different formats in the middle, the error will stop and the data will not be saved. Can I skip what I can't extract automatically?
Add code to a program
Continue to the next step when an error occurs.
Sub-extraction information ()
range(" a 1 ")current region . offset( 1,0)。 Clear content
Cells. Borders.LineStyle = xlNone
Apply. ScreenUpdating = False
Dim Word as Word. document
Dim wordapp as an object
Dim cPath$,cFile$,i%,arr()
cPath = ThisWorkbook。 Path and path. "\"
cFile = Dir(cPath & amp; "*. Doc? ”)
Set wordapp = CreateObject("word. Application ")
Do While cFile & lt& gt""
Set wordD = wordapp. Documents. Open (cPath & ampcFile)
i = i + 1
ReDim Preserve arr( 1 to 4, 1 to I)
With wordD
Arr( 1, i) = Replace (. paragraphs( 18). range . text,Chr(7),""),Chr( 13),"")
arr(3,i) = Replace(Replace(。 Paragraph (20).Range.Text, Chr(7), ""), Chr( 13), "")
arr(2,i) = Replace(Replace(。 Paragraphs(44).Range.Text,Chr(7),""),Chr( 13),"")
arr(4,i) = Replace(Replace(。 Paragraphs(82).Range.Text,Chr(7),""),Chr( 13),"")
End with ...
wordD。 close
cFile = Dir
ring
Set wordD = Nothing.
wordapp。 give up
Range ("a2"). Adjust the size (I, 4). Value = application. transposition
Scope ("a1:d"&; I+ 1). borders . line style = XL continuous
Apply. ScreenUpdating = True
End joint
Tip The project library cannot be found.
Please look at the picture and quote the following options.
- Related articles
- Teaching staff of No. 2 Experimental Primary School in Laoshan District, Qingdao
- What are the medium and large companies in Zhuhai?
- Does Huizhou Chen Jiang Guangdong Tengyue Company pay wages on time?
- What units are there in state-owned enterprises?
- An electrician?
- Is it common for college students to sign contracts on the spot after the job fair? Do you want to consider the time?
- What certificate do you need for Korean translation? How can you become a Korean translator? What is your annual salary?
- Where does Xiamen Federation of Trade Unions generally take an examination of recruiting trade union commissioners?
- Why does Beijing Repatriation Center of National Immigration Bureau require graduate education or above?
- The organizational structure of the Central Ethnic Song and Dance Ensemble