Not recognizing text in a cell

S

skrimpy

With a couple of tables I want move down a line (rows in tables an
lines outside of tables)for each loop the and then return the number o
lines. The text Im looking for is inside of a cell and it is no
recognizing the text and breaking the loop. Am I missing something?

Sub TestCell()
'declare variables
Dim X As Integer
Selection.HomeKey unit:=wdStory
Selection.MoveRight unit:=wdCell

'loop
X = 1
Do
Selection.MoveDown unit:=wdLine, Count:=1
X = X + 1
Loop Until Selection.Text = "Texttostoploop"
End Su
 

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