Extract Data from specific places in multiple word files to excel

youbitto

Board Regular
Joined
Jun 8, 2022
Messages
61
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
Hello MrExcel Genuises

I have Multiple word Files that has some data that I need to extract to excel

the documents has over 40 pages and the data I need are in separated pages

I am Asking if there is a way or macro in excel to that work automaticaly

here an example in word :

1742129786235.png


what i want to be filled in excel

Nouveau Feuille de calcul Microsoft Excel.xlsx
ABCD
1NameAgeBirth Adresse
2
3
4
Feuil2



Thank you
 
Upvote 0
I looked at the image and thought there was a space " " before the colon. In fact, it is "hard space" (code point = 160).
Change
Code:
regex.Pattern = "^" & a(col - 1) & " *:(.+?)$"
to
Code:
regex.Pattern = "^" & a(col - 1) & "[ \t\xA0]*:(.+?)$"

The new code accepts space " ", TAB, "hard space" - [ \t\xA0]
Thank you Mr.hungtbatman1 It works now perfectly
 
Upvote 0
Please don't take offence, I would just like to understand your code. I know what Chr is but why use it in this fashion? Dave
eg.
VBA Code:
.Title = Chr(83) & Chr(101) & Chr(108) & Chr(101) & Chr(99) & Chr(116) & Chr(32) & _
             Chr(70) & Chr(105) & Chr(108) & Chr(101)
 
Upvote 0
Please don't take offence, I would just like to understand your code. I know what Chr is but why use it in this fashion? Dave
eg.
VBA Code:
.Title = Chr(83) & Chr(101) & Chr(108) & Chr(101) & Chr(99) & Chr(116) & Chr(32) & _
             Chr(70) & Chr(105) & Chr(108) & Chr(101)
Please check. This is not my code. My code does not have CHR.
 
Upvote 0
Well my bad. I can understand your code. My apologies. Thanks for the clarification. Perhaps @Sam_D_Ben can provide us with some enlightenment. Have a nice day. Dave
 
Upvote 0
Well my bad. I can understand your code. My apologies. Thanks for the clarification. Perhaps @Sam_D_Ben can provide us with some enlightenment. Have a nice day. Dave
Hi Dave how are you, "that is to prevent something" , hope you know it. Have a good one !
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top