MAcro to find text only on first row of table

S

smiba

Hi,

I have a macro that uses Selection.Find to locate text and then deletes the
column of the table where the text is found. How would I add the criteria to
only delete the row if the text found is in the first row?

Using Word 2003

Thanks
 
H

Helmut Weber

Hi,


Selection.Information(wdEndOfRangeRowNumber)
returns the row number where the end of the selection is.

So:

if Selection.Information(wdEndOfRangeRowNumber)= 1 then
'your code
endif

There is too: Selection.Information(wdStartOfRangeRowNumber)
--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

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