#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
I will try to combine run iteration on combinations.
Thank you!! |
#8
|
|||
|
|||
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
|
||||
|
||||
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] |
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 |
Macro Question: Need help making a macro to highlight the first word in every sentence | LadyAna | Word | 1 | 12-06-2014 10:39 PM |
Word 2003 Macro problem running in Word 2010 | norwood | Word VBA | 2 | 02-03-2014 06:49 PM |