View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_5_] Jim Thomlinson[_5_] is offline
external usenet poster
 
Posts: 486
Default Save Cell Properties into an Array

This must be why they pay you the big money... I never even thought to do
that. As a guess though how much faster would it be than just looping through
the range and adding a format as the OP requested. Lots? A little? Not much
if any?
--
HTH...

Jim Thomlinson


"Tom Ogilvy" wrote:

You can read the formula into an array, but not any properties.

You can then check each item for a leading =

constants will also be read into the array.


v = Range("A1:F30").Formula

from the immediate window:

v = Range("A1:F30").Formula
? v(1,1)
=TRUNC(RAND()*100+1)
? v(1,2)
49


--
Regards,
Tom Ogilvy


wrote in message
oups.com...
I often read and write chunks of Excel data by reading them into a
variant array, process the data, and then write the changes back. As
most know this is a very effecient method.

I would like to do the same think with a range of cell properties. For
example I would like to be able to individually check which cells on a
sheet contain a formula. I am currently reading the cells into a range
object and looping through each cell in the range. The ones with a
formula I am applying a special format.

Is it possible to read the .HasFormula property into a variant array
and loop through the array instead of through the range. I think it
might be faster but cannot get it to work.

Any help or direction is appreciated.
Thanks
Darryl Smith