Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Fastest way to reference a particular cell?

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Fastest way to reference a particular cell?

Not really

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Maury Markowitz" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fastest way to store each word in a cell in a diff variable J@Y Excel Programming 1 July 25th 07 02:56 PM
Repeating a Cell Format For Many Rows: What's Fastest Way? TomBrooklyn Excel Discussion (Misc queries) 3 November 2nd 05 02:51 PM
problem with cell reference in =sum(offset(cell reference,x,y,z,a)). Want cell ref to be variable. [email protected] Excel Worksheet Functions 2 December 11th 04 12:05 AM
Problem with =sum(offset(cell reference,w,x,y,z). I want cell reference to be variable [email protected] Excel Worksheet Functions 2 December 11th 04 12:00 AM
Fastest way to do this? Abu Ali Excel Programming 4 January 12th 04 09:24 AM


All times are GMT +1. The time now is 07:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"