View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
John[_19_] John[_19_] is offline
external usenet poster
 
Posts: 87
Default find by font size

I just wanted to find every cell that had font size 18 in it. That cell
value was deleted from a string of values. I was looking for values that
hadn't been used yet. After running the process, that's what is left in
the string. Other than that I had no interest in preserving what was found.

"Available" is the starting string and "FoundFirst" is my range variable
holding the found cell with font size 18. So I do a lot of:

Available = Replace(Available, FoundFirst, "")

The find method must be looking at every cell and doing some sort of
"if... then" thing just like a for/next loop. I'm just old school
believing "machine language" is faster than "compiled language" when
doing things.

John

Rick Rothstein wrote:
While the output we all produced is the same, the method to get there is
different. My code creates a range via the Union function whereas the
others' code simply concatenates the addresses into a string for
display. The difference is that the range I produce from the union can
be manipulated directly in the routine as needed (select all the cells,
change the cells' format in some way, etc.). Now, it is true, you can do
the same to the Range(rngfound.Address) range, but I don't know if that
would be considered as "clean" a method to use or not. As for your speed
question... I'm not entirely sure how fast creating Unions are, but I
don't think the mechanism is all that slow; string concatenations, on
the other hand, is not one of VB's speediest processes (especially if
the strings get large in value).