View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Fastest way to reference a particular cell?

Genearlly speaking I concur with Don in that there is no difference in what
you have posted...

Cells referes to a single cell where as range can refer to a group of cells.
Since there are differences though I do tend to use them under different
circumstances.

When I want a single cell referenced by some kind of variable I use Cells.
So in your example I would use Cells something like this
Cells(i, "AB")
I find createing a concatenated string to be awkward and at time error prone.

I tend to use range when the Cell reference is hard coded such as
Range("A1")
As I find that easier to read. I also use it when I need a range of cells
like this
=range(range("A1"), cells(i, "AB"))

That is my personal preference. The best thing that I can recommend is to be
consistent. It will make your code easier to read and understand.

--
HTH...

Jim Thomlinson


"Maury Markowitz" wrote:

Is there any "best way" to access the contents of a cell? IE, is there
any real difference between...

ActiveSheet.Cells(i,j)

or

ActiveSheet.Range("AB" & i)

Maury