Simple Array question

  • Thread starter Thread starter Tom Walker
  • Start date Start date
T

Tom Walker

hi,
I have a function "HiddenItemslist" which returns an
array of items. How do I know the no of items in the
array after the function assignment?

Like this:

Dim A as variant

A = ActiveSheet.PivotTables("PivotTable1").PivotFields
("[Project].[Project Name]"). _
HiddenItemsList


"A" will have a list of items. Basically I want to
traverse thru the list to see if an item that I want is
there is not. how do I do this?

Thanks,
Tom
 
If A is a "vertical" one-"column" list

Ubound(A)-Lbound(A)+1

will return the number of elements.

If it's a "horizontal" one-"row" list, then it depends on whether A is
one-dimensional or two-dimensional. If one

Ubound(A)-Lbound(A)+1 as above. If two-dimensional

Ubound(A,2)-lbound(A,2)+1

Alan Beban
 
Back
Top