View Single Post
 
Old 02-06-2016, 03:21 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,385
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

Quote:
Originally Posted by PRA007 View Post
So the question is, If My StrTxt contains multiple occurrences of a string like "string", how to get all of it.

For example in hypothetical string.

Code:
StrTxt = "mmrkxyz" & vbCr & "mmrkyzx" & vbCr & "xyz" & vbCr & "yzx" & vbCr & "mmarkxxx"
Now I Just want to get all the lines that have initial mmrk as string like this, so that I can further process it.
Well, I'm sure you know that a simple Find/Replace in Word can process all instances in a single pass, which is why it might be good to open the file with Word. And, for simple strings in VBA, so to could the VBA Replace method process all instances in a single pass.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote