View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default How to track object index in object collection

I generally prefer to be explicit.

AFAIK, it compiles the same, so it doesn't matter one way or the other
for efficiency.

However, for my own efficiency in reading code I wrote six months ago,
the more explicit I was, the better.

And for anyone who tries to maintain my code and doesn't use the "col"
convention, it's immediately obvious that the variable refers to a
collection rather than an array.

Just my US$0.02.


In article ,
Jim Thomlinson wrote:

Just curious. Is there any advantage to using

colRanges.Item(i)
over
colRanges(i)

I use the .item when I have the object as part of a with but otherwise I
tend to omit it.

with colRanges
.item(i)
end with