Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 06-25-2019, 08:30 AM
priyadharshane priyadharshane is offline Interpretation of Word Macro Windows 10 Interpretation of Word Macro Office 2016
Novice
Interpretation of Word Macro
 
Join Date: Jun 2019
Posts: 6
priyadharshane is on a distinguished road
Default Interpretation of Word Macro

Hello all,



I'm new to Word macro. A Word expert has supported me to automate capturing specific contents from word to excel. Now, I need some little more modification with mentioned macro file.

Can someone guide to explain below word macros please? It will make easier to modify based on my requirement

.Text = "Declaration*NIC*^13*[^12^13]{1,}" - What does ^13*[^12^13]{1,} means?

.Text = "[ ]{1,}[OI][rn][id][gi][ia][[n]*Inv No & Dt.*^13" - What does [ ]{1,}[OI][rn][id][gi][ia][[n]?

.Text = "([0-9]{1,})[!^13]@| ([A-Z0-9]@>)*([0-9.]{4,5} %)*([0-9.]{4,5} %)*([0-9.]{4,5} %)*^13" -

How it works?

Above macro used to pull part numbers, what if there is a symbol mentioned in part number or like this PK_2314K16 ? Will it capture it

Also, need understanding if it meant for one row or can be used for two rows of specific data like this

173 73079290 ADAPTER AS.-ELBOW 90 DEG (NON ELECTRICAL) (50 NOS)
| 1068715

.Replacement.Text = "\1^t\2^t\3^t\4^t\5^p" - What does it mean?
  #2  
Old 06-25-2019, 11:11 AM
kilroy kilroy is offline Interpretation of Word Macro Windows 10 Interpretation of Word Macro Office 2016
Competent Performer
 
Join Date: Sep 2016
Location: Southern Ontario
Posts: 118
kilroy is on a distinguished road
Default

Grahams page would be useful to read to figure out what some of the special charcters are:


Replace using wildcards


these as well:
Finding and replacing non-printing characters (such as paragraph marks), other special characters, and text formatting
Finding and replacing characters using wildcards
  #3  
Old 06-25-2019, 11:28 AM
priyadharshane priyadharshane is offline Interpretation of Word Macro Windows 10 Interpretation of Word Macro Office 2016
Novice
Interpretation of Word Macro
 
Join Date: Jun 2019
Posts: 6
priyadharshane is on a distinguished road
Default Need your support on below post

Thank you kilroy,

One more question,

.Text = "([0-9]{1,})[!^13]@| ([A-Z0-9]@>)*([0-9.]{4,5} %)*([0-9.]{4,5} %)*([0-9.]{4,5} %)*^13" -

Can you above code help to capture text such as PK_2314K16? Do I need to modify it?

As well as it's not capturing if it's in next line. i.e. When I run set of data, it only capture if it is one line and leave content alone if it's second line
e.g. I need to capture 1068715

173 73079290 ADAPTER AS.-ELBOW 90 DEG (NON ELECTRICAL) (50 NOS)
| 1068715

Any support on this query please?
  #4  
Old 06-25-2019, 11:46 AM
kilroy kilroy is offline Interpretation of Word Macro Windows 10 Interpretation of Word Macro Office 2016
Competent Performer
 
Join Date: Sep 2016
Location: Southern Ontario
Posts: 118
kilroy is on a distinguished road
Default

I'm definitely not the best guy to answer questions but if you are searching for a string where 2 letters - underscore - 4 numbers - 1 letter - 2 numbers then:


Find=[A-Z]{2}_[0-9]{4,}[A-Z]{1,}[0-9]{2}


is the naming convention always the same? (PK_2314K16)


Best to post a sample of what you are looking for and what to replace it with.
  #5  
Old 06-25-2019, 12:06 PM
priyadharshane priyadharshane is offline Interpretation of Word Macro Windows 10 Interpretation of Word Macro Office 2016
Novice
Interpretation of Word Macro
 
Join Date: Jun 2019
Posts: 6
priyadharshane is on a distinguished road
Default

Hiii,

I need below code to get modified to capture

Text which as PK_2314K161 (Total Characters is 11), 1186878 (total Characters 7), 9R2613 (Total Characters 6). As of now, it's capturing 1186878 & 9R2613

Also, need to capture if it's in second line as well. As of now, it's capturing if it's in one row

173 73079290 ADAPTER AS.-ELBOW 90 DEG (NON ELECTRICAL) (50 NOS)
| 1068715

.Text = "([0-9]{1,})[!^13]@| ([A-Z0-9]@>)*([0-9.]{4,5} %)*([0-9.]{4,5} %)*([0-9.]{4,5} %)*^13"
  #6  
Old 06-25-2019, 12:55 PM
kilroy kilroy is offline Interpretation of Word Macro Windows 10 Interpretation of Word Macro Office 2016
Competent Performer
 
Join Date: Sep 2016
Location: Southern Ontario
Posts: 118
kilroy is on a distinguished road
Default

Individually the find expressions are as follows below. I can't tie them together. When I tried I got an error message saying the find was too complicated. Good luck


PK_2314K161 Find = [A-Z]{2}_[0-9]{4,}[A-Z]{1}[0-9]{2}
1186878 Find = [0-9]{7}
9R2613 Find = [0-9]{1} [A-Z]{1} [0-9]{4})
  #7  
Old 06-25-2019, 01:35 PM
priyadharshane priyadharshane is offline Interpretation of Word Macro Windows 10 Interpretation of Word Macro Office 2016
Novice
Interpretation of Word Macro
 
Join Date: Jun 2019
Posts: 6
priyadharshane is on a distinguished road
Default

I will try to combine run iteration on combinations.

Thank you!!
  #8  
Old 06-25-2019, 05:27 PM
priyadharshane priyadharshane is offline Interpretation of Word Macro Windows 10 Interpretation of Word Macro Office 2016
Novice
Interpretation of Word Macro
 
Join Date: Jun 2019
Posts: 6
priyadharshane is on a distinguished road
Default

Bad luck!! it causing error after trying different combinations

I need below code to get modified to capture

Text which as PK_2314K161 (Total Characters is 11), 1186878 (total Characters 7), 9R2613 (Total Characters 6). As of now, it's capturing 1186878 & 9R2613

Also, need to capture if it's in second line as well. As of now, it's capturing if it's in one row

173 73079290 ADAPTER AS.-ELBOW 90 DEG (NON ELECTRICAL) (50 NOS)
| 1068715

.Text = "([0-9]{1,})[!^13]@| ([A-Z0-9]@>)*([0-9.]{4,5} %)*([0-9.]{4,5} %)*([0-9.]{4,5} %)*^13"
  #9  
Old 06-25-2019, 07:35 PM
macropod's Avatar
macropod macropod is offline Interpretation of Word Macro Windows 7 64bit Interpretation of Word Macro Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Cross-posted at: support to capture specific data from Word to Excel using VBA Automation - Page 5
For cross-posting etiquette, please read: Excelguru Help Site - A message to forum cross posters

For anyone else who's interested, the cross-post shows I'd already given the OP extensive help there, only to have him keep changing the specifications at every stage.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Closed Thread

Tags
word macro



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to transfer data from Word to another Word document with bookmark Jovan Yong Word VBA 3 04-17-2018 04:27 AM
macro error message - interpretation H28Sailor Excel Programming 3 03-03-2017 07:37 AM
Macro to put 1 word of a MS Word file in 1 cell of a Word or Excel Table Singh_Edm Word VBA 6 11-13-2015 08:48 PM
Interpretation of Word Macro Macro Question: Need help making a macro to highlight the first word in every sentence LadyAna Word 1 12-06-2014 10:39 PM
Interpretation of Word Macro Word 2003 Macro problem running in Word 2010 norwood Word VBA 2 02-03-2014 06:49 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:05 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft