X is the issue to this macro

S

Steved

Hello from Steved

8 IRISH DIAMOND 4 68X534
13 SILK N SATIN 055

The below macro will highlite 8 IRISH DIAMOND and 13 SILK N SATIN

8 IRISH DIAMOND X4 68534
13 SILK N SATIN X4 68534

The below macro will highlite 8 IRISH DIAMOND X4 68534 and 13
SILK N SATIN X4 68534


With the below macro how can I make it highlite "8 IRISH DIAMOND" and "13
SILK N SATIN" not '8 IRISH DIAMOND X4 68534" and "13 SILK N
SATIN X4 68534"

The issue is the X


Sub Highliter()
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[0-9 ]{1,}[A-Z ]{1,}"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtend
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[A-Z ]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
ActiveDocument.Save
Selection.Font.Color = wdColorRed
Options.DefaultHighlightColorIndex = wdYellow
Selection.Range.HighlightColorIndex = wdYellow
Selection.HomeKey Unit:=wdLine
End Sub

Thankyou
 
S

StevenM

To: Steved,

Are you for sure using Find is the best way of going about this? I think
that if we had a better discription of your document, we might be able to
come up with a better way of solving your problem.

8 IRISH DIAMOND X4 68534
13 SILK N SATIN X4 68534

In Word a paragraph is a series of text which ends in a paragraph mark.
Often lines like those of yours above come as seperate paragraphs. So that
each line is a paragraph. If so, perhaps we can search paragraphs looking for
paragraphs with a particular format.

What type of font is being used? If it is a monospaced font, then we might
be able to determine the length of each line, and the position of each item
on the line.

In the above example, it appears we have four columns.
Column 1: a number (perhaps one or two digits)
Column 2: a discription in uppercase (followed by flexible space)
Column 3: a two character code
Column 4: a five digit number (or five character code)

Is this correct?

Steven Craig Miller
 
S

Steved

Hello Steven

Thankyou for your promt reply

Firstly one Paragraph ( on the same line )

Column 1: a number (perhaps one or two digits) as said "one or two digits"
Column 2: a discription in uppercase (followed by flexible space) "Yes"

Ok Column 2 as above has a flexible space my question is after the flexible
space can I instruct the macro if "X" is found at the begining off the digits
in column 3 after the flexible space just hightlite the two digits and the
Discription only ( always in uppercase )


Thankyou

Column 3: and Column 4 are one off the same meaning sometimes it will have a
space and it can be 20 digits long with the possibilty off an X ( Character )
amongst it.



StevenM said:
To: Steved,

Are you for sure using Find is the best way of going about this? I think
that if we had a better discription of your document, we might be able to
come up with a better way of solving your problem.

8 IRISH DIAMOND X4 68534
13 SILK N SATIN X4 68534

In Word a paragraph is a series of text which ends in a paragraph mark.
Often lines like those of yours above come as seperate paragraphs. So that
each line is a paragraph. If so, perhaps we can search paragraphs looking for
paragraphs with a particular format.

What type of font is being used? If it is a monospaced font, then we might
be able to determine the length of each line, and the position of each item
on the line.

In the above example, it appears we have four columns.
Column 1: a number (perhaps one or two digits)
Column 2: a discription in uppercase (followed by flexible space)
Column 3: a two character code
Column 4: a five digit number (or five character code)

Is this correct?

Steven Craig Miller

Steved said:
Hello from Steved

8 IRISH DIAMOND 4 68X534
13 SILK N SATIN 055

The below macro will highlite 8 IRISH DIAMOND and 13 SILK N SATIN

8 IRISH DIAMOND X4 68534
13 SILK N SATIN X4 68534

The below macro will highlite 8 IRISH DIAMOND X4 68534 and 13
SILK N SATIN X4 68534


With the below macro how can I make it highlite "8 IRISH DIAMOND" and "13
SILK N SATIN" not '8 IRISH DIAMOND X4 68534" and "13 SILK N
SATIN X4 68534"

The issue is the X


Sub Highliter()
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[0-9 ]{1,}[A-Z ]{1,}"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtend
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[A-Z ]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
ActiveDocument.Save
Selection.Font.Color = wdColorRed
Options.DefaultHighlightColorIndex = wdYellow
Selection.Range.HighlightColorIndex = wdYellow
Selection.HomeKey Unit:=wdLine
End Sub

Thankyou
 
D

Doug Robbins - Word MVP

Also, what separates the DIAMOND and SATIN from the X4?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

StevenM said:
To: Steved,

Are you for sure using Find is the best way of going about this? I think
that if we had a better discription of your document, we might be able to
come up with a better way of solving your problem.

8 IRISH DIAMOND X4 68534
13 SILK N SATIN X4 68534

In Word a paragraph is a series of text which ends in a paragraph mark.
Often lines like those of yours above come as seperate paragraphs. So that
each line is a paragraph. If so, perhaps we can search paragraphs looking
for
paragraphs with a particular format.

What type of font is being used? If it is a monospaced font, then we might
be able to determine the length of each line, and the position of each
item
on the line.

In the above example, it appears we have four columns.
Column 1: a number (perhaps one or two digits)
Column 2: a discription in uppercase (followed by flexible space)
Column 3: a two character code
Column 4: a five digit number (or five character code)

Is this correct?

Steven Craig Miller

Steved said:
Hello from Steved

8 IRISH DIAMOND 4 68X534
13 SILK N SATIN 055

The below macro will highlite 8 IRISH DIAMOND and 13 SILK N SATIN

8 IRISH DIAMOND X4 68534
13 SILK N SATIN X4 68534

The below macro will highlite 8 IRISH DIAMOND X4 68534 and
13
SILK N SATIN X4 68534


With the below macro how can I make it highlite "8 IRISH DIAMOND" and "13
SILK N SATIN" not '8 IRISH DIAMOND X4 68534" and "13 SILK
N
SATIN X4 68534"

The issue is the X


Sub Highliter()
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[0-9 ]{1,}[A-Z ]{1,}"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtend
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[A-Z ]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
ActiveDocument.Save
Selection.Font.Color = wdColorRed
Options.DefaultHighlightColorIndex = wdYellow
Selection.Range.HighlightColorIndex = wdYellow
Selection.HomeKey Unit:=wdLine
End Sub

Thankyou
 
S

StevenM

To: Steved,

You didn't answer my question as to which font you are using? If it is a
monospaced font, that will help us.

Also, I noticed that the items you posted appear to have been cut and pasted
and if one looks at the hidden characters, one sees (something like):

°••8•IRISH•DIAMOND°•°•°•°•°•°•°•°•X4•68534¶
°•13•SILK•N•SATIN°•°•°•°•°•°•°•°•°•X4•68534¶

The last character (¶) is Word's paragraph mark. The other two characters
represent a non-breaking space and a (plain) space.

Do you know why non-breaking spaces are used this way in your document?

From the above, it appears that the 2nd column begins six characters from
the beginning of the line, and ends with a non-breaking space. Is that true
all of the time?

What font is being used?
Does the third column always start in the same place?

After all, we have already determined that each line is a paragraph. If the
third column starts at the same place in every line, that will simplify
things greatly.

If you like, you could e-mail me a copy of your document, or a mock-up of
your document. Obviously, I don't want any sensitive information sent to me.

Steven Craig Miller

Steved said:
Hello Steven

Thankyou for your promt reply

Firstly one Paragraph ( on the same line )

Column 1: a number (perhaps one or two digits) as said "one or two digits"
Column 2: a discription in uppercase (followed by flexible space) "Yes"

Ok Column 2 as above has a flexible space my question is after the flexible
space can I instruct the macro if "X" is found at the begining off the digits
in column 3 after the flexible space just hightlite the two digits and the
Discription only ( always in uppercase )


Thankyou

Column 3: and Column 4 are one off the same meaning sometimes it will have a
space and it can be 20 digits long with the possibilty off an X ( Character )
amongst it.



StevenM said:
To: Steved,

Are you for sure using Find is the best way of going about this? I think
that if we had a better discription of your document, we might be able to
come up with a better way of solving your problem.

8 IRISH DIAMOND X4 68534
13 SILK N SATIN X4 68534

In Word a paragraph is a series of text which ends in a paragraph mark.
Often lines like those of yours above come as seperate paragraphs. So that
each line is a paragraph. If so, perhaps we can search paragraphs looking for
paragraphs with a particular format.

What type of font is being used? If it is a monospaced font, then we might
be able to determine the length of each line, and the position of each item
on the line.

In the above example, it appears we have four columns.
Column 1: a number (perhaps one or two digits)
Column 2: a discription in uppercase (followed by flexible space)
Column 3: a two character code
Column 4: a five digit number (or five character code)

Is this correct?

Steven Craig Miller

Steved said:
Hello from Steved

8 IRISH DIAMOND 4 68X534
13 SILK N SATIN 055

The below macro will highlite 8 IRISH DIAMOND and 13 SILK N SATIN

8 IRISH DIAMOND X4 68534
13 SILK N SATIN X4 68534

The below macro will highlite 8 IRISH DIAMOND X4 68534 and 13
SILK N SATIN X4 68534


With the below macro how can I make it highlite "8 IRISH DIAMOND" and "13
SILK N SATIN" not '8 IRISH DIAMOND X4 68534" and "13 SILK N
SATIN X4 68534"

The issue is the X


Sub Highliter()
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[0-9 ]{1,}[A-Z ]{1,}"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtend
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[A-Z ]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
ActiveDocument.Save
Selection.Font.Color = wdColorRed
Options.DefaultHighlightColorIndex = wdYellow
Selection.Range.HighlightColorIndex = wdYellow
Selection.HomeKey Unit:=wdLine
End Sub

Thankyou
 
S

Steved

Hello from Steved

Pleas excuse my ignorance and I thankyou for your patience

I would like to email my document to you.

The reason I would like to do this is that my explaining is not the best.

How do I go about this please

I Thankyou

Steve





StevenM said:
To: Steved,

You didn't answer my question as to which font you are using? If it is a
monospaced font, that will help us.

Also, I noticed that the items you posted appear to have been cut and pasted
and if one looks at the hidden characters, one sees (something like):

°••8•IRISH•DIAMOND°•°•°•°•°•°•°•°•X4•68534¶
°•13•SILK•N•SATIN°•°•°•°•°•°•°•°•°•X4•68534¶

The last character (¶) is Word's paragraph mark. The other two characters
represent a non-breaking space and a (plain) space.

Do you know why non-breaking spaces are used this way in your document?

From the above, it appears that the 2nd column begins six characters from
the beginning of the line, and ends with a non-breaking space. Is that true
all of the time?

What font is being used?
Does the third column always start in the same place?

After all, we have already determined that each line is a paragraph. If the
third column starts at the same place in every line, that will simplify
things greatly.

If you like, you could e-mail me a copy of your document, or a mock-up of
your document. Obviously, I don't want any sensitive information sent to me.

Steven Craig Miller

Steved said:
Hello Steven

Thankyou for your promt reply

Firstly one Paragraph ( on the same line )

Column 1: a number (perhaps one or two digits) as said "one or two digits"
Column 2: a discription in uppercase (followed by flexible space) "Yes"

Ok Column 2 as above has a flexible space my question is after the flexible
space can I instruct the macro if "X" is found at the begining off the digits
in column 3 after the flexible space just hightlite the two digits and the
Discription only ( always in uppercase )


Thankyou

Column 3: and Column 4 are one off the same meaning sometimes it will have a
space and it can be 20 digits long with the possibilty off an X ( Character )
amongst it.



StevenM said:
To: Steved,

Are you for sure using Find is the best way of going about this? I think
that if we had a better discription of your document, we might be able to
come up with a better way of solving your problem.

8 IRISH DIAMOND X4 68534
13 SILK N SATIN X4 68534

In Word a paragraph is a series of text which ends in a paragraph mark.
Often lines like those of yours above come as seperate paragraphs. So that
each line is a paragraph. If so, perhaps we can search paragraphs looking for
paragraphs with a particular format.

What type of font is being used? If it is a monospaced font, then we might
be able to determine the length of each line, and the position of each item
on the line.

In the above example, it appears we have four columns.
Column 1: a number (perhaps one or two digits)
Column 2: a discription in uppercase (followed by flexible space)
Column 3: a two character code
Column 4: a five digit number (or five character code)

Is this correct?

Steven Craig Miller

:

Hello from Steved

8 IRISH DIAMOND 4 68X534
13 SILK N SATIN 055

The below macro will highlite 8 IRISH DIAMOND and 13 SILK N SATIN

8 IRISH DIAMOND X4 68534
13 SILK N SATIN X4 68534

The below macro will highlite 8 IRISH DIAMOND X4 68534 and 13
SILK N SATIN X4 68534


With the below macro how can I make it highlite "8 IRISH DIAMOND" and "13
SILK N SATIN" not '8 IRISH DIAMOND X4 68534" and "13 SILK N
SATIN X4 68534"

The issue is the X


Sub Highliter()
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[0-9 ]{1,}[A-Z ]{1,}"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtend
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[A-Z ]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
ActiveDocument.Save
Selection.Font.Color = wdColorRed
Options.DefaultHighlightColorIndex = wdYellow
Selection.Range.HighlightColorIndex = wdYellow
Selection.HomeKey Unit:=wdLine
End Sub

Thankyou
 
S

StevenM

To: Steved,

stevencraigmiller(at)comcast(dot)net

Make the obvious substitutions.

Steven Craig Miller

Steved said:
Hello from Steved

Pleas excuse my ignorance and I thankyou for your patience

I would like to email my document to you.

The reason I would like to do this is that my explaining is not the best.

How do I go about this please

I Thankyou

Steve





StevenM said:
To: Steved,

You didn't answer my question as to which font you are using? If it is a
monospaced font, that will help us.

Also, I noticed that the items you posted appear to have been cut and pasted
and if one looks at the hidden characters, one sees (something like):

°••8•IRISH•DIAMOND°•°•°•°•°•°•°•°•X4•68534¶
°•13•SILK•N•SATIN°•°•°•°•°•°•°•°•°•X4•68534¶

The last character (¶) is Word's paragraph mark. The other two characters
represent a non-breaking space and a (plain) space.

Do you know why non-breaking spaces are used this way in your document?

From the above, it appears that the 2nd column begins six characters from
the beginning of the line, and ends with a non-breaking space. Is that true
all of the time?

What font is being used?
Does the third column always start in the same place?

After all, we have already determined that each line is a paragraph. If the
third column starts at the same place in every line, that will simplify
things greatly.

If you like, you could e-mail me a copy of your document, or a mock-up of
your document. Obviously, I don't want any sensitive information sent to me.

Steven Craig Miller

Steved said:
Hello Steven

Thankyou for your promt reply

Firstly one Paragraph ( on the same line )

Column 1: a number (perhaps one or two digits) as said "one or two digits"
Column 2: a discription in uppercase (followed by flexible space) "Yes"

Ok Column 2 as above has a flexible space my question is after the flexible
space can I instruct the macro if "X" is found at the begining off the digits
in column 3 after the flexible space just hightlite the two digits and the
Discription only ( always in uppercase )


Thankyou

Column 3: and Column 4 are one off the same meaning sometimes it will have a
space and it can be 20 digits long with the possibilty off an X ( Character )
amongst it.



:

To: Steved,

Are you for sure using Find is the best way of going about this? I think
that if we had a better discription of your document, we might be able to
come up with a better way of solving your problem.

8 IRISH DIAMOND X4 68534
13 SILK N SATIN X4 68534

In Word a paragraph is a series of text which ends in a paragraph mark.
Often lines like those of yours above come as seperate paragraphs. So that
each line is a paragraph. If so, perhaps we can search paragraphs looking for
paragraphs with a particular format.

What type of font is being used? If it is a monospaced font, then we might
be able to determine the length of each line, and the position of each item
on the line.

In the above example, it appears we have four columns.
Column 1: a number (perhaps one or two digits)
Column 2: a discription in uppercase (followed by flexible space)
Column 3: a two character code
Column 4: a five digit number (or five character code)

Is this correct?

Steven Craig Miller

:

Hello from Steved

8 IRISH DIAMOND 4 68X534
13 SILK N SATIN 055

The below macro will highlite 8 IRISH DIAMOND and 13 SILK N SATIN

8 IRISH DIAMOND X4 68534
13 SILK N SATIN X4 68534

The below macro will highlite 8 IRISH DIAMOND X4 68534 and 13
SILK N SATIN X4 68534


With the below macro how can I make it highlite "8 IRISH DIAMOND" and "13
SILK N SATIN" not '8 IRISH DIAMOND X4 68534" and "13 SILK N
SATIN X4 68534"

The issue is the X


Sub Highliter()
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[0-9 ]{1,}[A-Z ]{1,}"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtend
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[A-Z ]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
ActiveDocument.Save
Selection.Font.Color = wdColorRed
Options.DefaultHighlightColorIndex = wdYellow
Selection.Range.HighlightColorIndex = wdYellow
Selection.HomeKey Unit:=wdLine
End Sub

Thankyou
 
S

Steved

Hello From Steved

Thankyou

StevenM said:
To: Steved,

stevencraigmiller(at)comcast(dot)net

Make the obvious substitutions.

Steven Craig Miller

Steved said:
Hello from Steved

Pleas excuse my ignorance and I thankyou for your patience

I would like to email my document to you.

The reason I would like to do this is that my explaining is not the best.

How do I go about this please

I Thankyou

Steve





StevenM said:
To: Steved,

You didn't answer my question as to which font you are using? If it is a
monospaced font, that will help us.

Also, I noticed that the items you posted appear to have been cut and pasted
and if one looks at the hidden characters, one sees (something like):

°••8•IRISH•DIAMOND°•°•°•°•°•°•°•°•X4•68534¶
°•13•SILK•N•SATIN°•°•°•°•°•°•°•°•°•X4•68534¶

The last character (¶) is Word's paragraph mark. The other two characters
represent a non-breaking space and a (plain) space.

Do you know why non-breaking spaces are used this way in your document?

From the above, it appears that the 2nd column begins six characters from
the beginning of the line, and ends with a non-breaking space. Is that true
all of the time?

What font is being used?
Does the third column always start in the same place?

After all, we have already determined that each line is a paragraph. If the
third column starts at the same place in every line, that will simplify
things greatly.

If you like, you could e-mail me a copy of your document, or a mock-up of
your document. Obviously, I don't want any sensitive information sent to me.

Steven Craig Miller

:

Hello Steven

Thankyou for your promt reply

Firstly one Paragraph ( on the same line )

Column 1: a number (perhaps one or two digits) as said "one or two digits"
Column 2: a discription in uppercase (followed by flexible space) "Yes"

Ok Column 2 as above has a flexible space my question is after the flexible
space can I instruct the macro if "X" is found at the begining off the digits
in column 3 after the flexible space just hightlite the two digits and the
Discription only ( always in uppercase )


Thankyou

Column 3: and Column 4 are one off the same meaning sometimes it will have a
space and it can be 20 digits long with the possibilty off an X ( Character )
amongst it.



:

To: Steved,

Are you for sure using Find is the best way of going about this? I think
that if we had a better discription of your document, we might be able to
come up with a better way of solving your problem.

8 IRISH DIAMOND X4 68534
13 SILK N SATIN X4 68534

In Word a paragraph is a series of text which ends in a paragraph mark.
Often lines like those of yours above come as seperate paragraphs. So that
each line is a paragraph. If so, perhaps we can search paragraphs looking for
paragraphs with a particular format.

What type of font is being used? If it is a monospaced font, then we might
be able to determine the length of each line, and the position of each item
on the line.

In the above example, it appears we have four columns.
Column 1: a number (perhaps one or two digits)
Column 2: a discription in uppercase (followed by flexible space)
Column 3: a two character code
Column 4: a five digit number (or five character code)

Is this correct?

Steven Craig Miller

:

Hello from Steved

8 IRISH DIAMOND 4 68X534
13 SILK N SATIN 055

The below macro will highlite 8 IRISH DIAMOND and 13 SILK N SATIN

8 IRISH DIAMOND X4 68534
13 SILK N SATIN X4 68534

The below macro will highlite 8 IRISH DIAMOND X4 68534 and 13
SILK N SATIN X4 68534


With the below macro how can I make it highlite "8 IRISH DIAMOND" and "13
SILK N SATIN" not '8 IRISH DIAMOND X4 68534" and "13 SILK N
SATIN X4 68534"

The issue is the X


Sub Highliter()
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[0-9 ]{1,}[A-Z ]{1,}"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtend
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[A-Z ]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
ActiveDocument.Save
Selection.Font.Color = wdColorRed
Options.DefaultHighlightColorIndex = wdYellow
Selection.Range.HighlightColorIndex = wdYellow
Selection.HomeKey Unit:=wdLine
End Sub

Thankyou
 
S

Steved

Hello Doug

I've now have my issue resolved and I thankyou.

Steved

Doug Robbins - Word MVP said:
Also, what separates the DIAMOND and SATIN from the X4?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

StevenM said:
To: Steved,

Are you for sure using Find is the best way of going about this? I think
that if we had a better discription of your document, we might be able to
come up with a better way of solving your problem.

8 IRISH DIAMOND X4 68534
13 SILK N SATIN X4 68534

In Word a paragraph is a series of text which ends in a paragraph mark.
Often lines like those of yours above come as seperate paragraphs. So that
each line is a paragraph. If so, perhaps we can search paragraphs looking
for
paragraphs with a particular format.

What type of font is being used? If it is a monospaced font, then we might
be able to determine the length of each line, and the position of each
item
on the line.

In the above example, it appears we have four columns.
Column 1: a number (perhaps one or two digits)
Column 2: a discription in uppercase (followed by flexible space)
Column 3: a two character code
Column 4: a five digit number (or five character code)

Is this correct?

Steven Craig Miller

Steved said:
Hello from Steved

8 IRISH DIAMOND 4 68X534
13 SILK N SATIN 055

The below macro will highlite 8 IRISH DIAMOND and 13 SILK N SATIN

8 IRISH DIAMOND X4 68534
13 SILK N SATIN X4 68534

The below macro will highlite 8 IRISH DIAMOND X4 68534 and
13
SILK N SATIN X4 68534


With the below macro how can I make it highlite "8 IRISH DIAMOND" and "13
SILK N SATIN" not '8 IRISH DIAMOND X4 68534" and "13 SILK
N
SATIN X4 68534"

The issue is the X


Sub Highliter()
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[0-9 ]{1,}[A-Z ]{1,}"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtend
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[A-Z ]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
ActiveDocument.Save
Selection.Font.Color = wdColorRed
Options.DefaultHighlightColorIndex = wdYellow
Selection.Range.HighlightColorIndex = wdYellow
Selection.HomeKey Unit:=wdLine
End Sub

Thankyou
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top