You can do it with wildcards in a Find and Replace (i.e. no need for VBA):
1. In the Find what box: (||)(*)(\>\>)
2. In the Replace with box: \2
3. While in the Replace with box, press Ctrl-B to set formatting to bold
4. Be sure that the "Use Wildcards" search option is on (click the More... button to see the options)
5. Click Replace All to effect the change.
The wildcard syntax finds three expressions: the "||" followed by any characters (represented by "*") and then the ">>" string. Since a ">" is a reserved character in a wildcard expression, you need to precede it with the release character "\". When this 3-part expression is found, it gets replaced with just the second expression: the "\2" represents the 2nd of the three expressions. By setting the format to bold, the found expression is also set to bold.
If your document is exactly as the sample you provided, you may need to include the space associated with your delimiters. For example, "(|| )(*)( \>\>)" used as the find expression will also remove the spaces after a || and before a >> string.
Main Topics
Browse All Topics





by: saurabh726Posted on 2009-04-30 at 09:33:37ID: 24271759
Assuming your data in column-A from the 1st cell till the last row of A Column, Then you can use the following code which will do what you are looking for...
Saurabh...
Select allOpen in new window