I have a macro which cycles through the contents of a field, which works great.
What I would like to do is cycle through the items in the list that meet a criteris in another, i.e. for this, only cycle through the 'names' which have a 'Y' in another column. These columns are connected in a table.
Is this possible? Code below.
Thanks!
Sub SelectNext
set mySelections = ActiveDocument.fields("Name").GetSelectedValues(1)
ActiveDocument.Fields("Name").Clear
if mySelections.Count = 0 then
set val=ActiveDocument.Fields("Name").GetPossibleValues(1)
ValueToSelect = val.Item(0).Text
else
set val=ActiveDocument.Fields("Name").GetPossibleValues
IamDone = " "
for i=0 to val.Count-1
ValueToSelect = val.Item(i).Text
if IamDone = "X" then
exit for
end if
if val.Item(i).Text = mySelections.Item(0).text then