Field Result

D

Daren White

I have a table with numeric fields in. I want to run a macro which deletes
rows of the table if the result of a field is 0. I cannot seem to get the
result into VBA. I have called the field POAC and bookmarked it ANSPC but
when I put in if POAC = 0 then application.run macroname:="tidyup" it runs
the macro even when the field is greater than 0

Any idea
 
H

Helmut Weber

Hi Daren,

I don't know of a way to name a field.

Try something like that:

If Selection.Cells(1).Range.Fields(1).Result = "5" Then
MsgBox "5"
End If
If ActiveDocument.Bookmarks("MyTest").Range.Fields(1).Result = "5"
Then
MsgBox "5"
End If

--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP
 

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