Alright, I have examined the solutions in this workbook. (It must be feeling like a cheap date by now. It's been passed around and we're all sharing stories about how fast it is.)
The macro I have written ("twice-sorted", for conversational purposes) strictly meets the specifications put forth in the original post. Input a value in an InputBox, and all rows that match that input in a predetermined column get shaded.
That said, I can shade every row that has an x in col1 in 2.9 seconds. All 41,000 or so of them. All rows that contain "name1" in col1 takes 2.3 seconds. Those times are averaged over 20 runs.
In light of that, the iterative methods are hardly worth examining. My previous study had runtimes of 2300 ms for 10,000 rows of data, which is comparable to the twice-sorted method with 65,000 rows.
The database functions written by Dale are certainly very powerful and provide more functionality than what I've written. That said, I still think I can shade 41,000 rows faster than those database functions
![[bigglasses] [bigglasses] [bigglasses]](/data/assets/smilies/bigglasses.gif)
but we're pushing the envelope of pragmatism.
The database functions do more for less code, and really what does a 2 second difference mean on 65,000 records? The trade-off is that I can write a macro to do everything the database function does and more, but let's not skin a cat with a chainsaw.
For public interest, I'm going to clean up and post the routine I have to time algorithms. I've used it to conclude that
Code:
If Not (name) Is Nothing Then
is 4% faster than
Code:
If (name) Is Nothing Then
Else
(actual instructions)
as well as analyze the algorithms we've talked about here.
In conclusion, if those database functions do what you want, then I would take them and run. If you want more customizable control without any sacrifice in speed, an optimized macro will fit the bill.