CustomFieldValueList Question?

D

Dan

Question,

I am setting a variable = to a value in a custom field
value list that resides in Text1. Once the variable is
set my macro cycles through the entire project looking for
occurrences where that custom value is used in Text1.
Once it reaches the end of the project it moves to the
next value in the custom value list and again goes through
the project and so on and so on.

My problem is that once the macro runs out of values in
the list it creates an error. How do I have it cycle
through the list and stop after the last value has been
tested. I am sure there is something easy out there like
for "each v in CustomValueList" but I can't get it to
work.

Thanks for your help.

Dan
 
J

John

Dan,
Normally the Count property can be used to get the number of items in a
collection, but a quick look at the object library didn't show any way
to use that method in this case. It's not saying there isn't a method, I
just didn't find it. However, you can always use the old standby, "On
Error Resume Next" to graciously exit the value list loop. Don't forget
to reset the error by using "On Error GoTo 0" before going back into the
loop.

Hope this helps.
John
 

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