Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Speed - or lack of it

I have a range of 5 columns 2000 rows long.
I need to look up one specific date in the 1st column.
Is it faster to use ".Find" or " For Each...Next".
I will not ".Select" the found item.
Any advice much appreciated.
Don
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Speed - or lack of it

While I suspect the Find method will be faster, it might be easiest if
you checked the performance of the two options yourself.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
I have a range of 5 columns 2000 rows long.
I need to look up one specific date in the 1st column.
Is it faster to use ".Find" or " For Each...Next".
I will not ".Select" the found item.
Any advice much appreciated.
Don

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Speed - or lack of it

Find would be faster, but it often has trouble with finding dates. I would
use application.Match

Dim res as Variant, rng as Range, myDate as Date
With Worksheets("Data")
set rng = .Range(.Cells(1,1),.Cells(rows.count,1).End(xlup))
End With
myDate = #12/23/2004#
res = Application.Match(clng(myDate),rng,0)
if not iserror(res) then
msgbox "Found in cell " & rng(res).Address
Else
msgbox "Not found"
End if

--
Regards,
Tom Ogilvy


"Don Bowyer" wrote in message
...
I have a range of 5 columns 2000 rows long.
I need to look up one specific date in the 1st column.
Is it faster to use ".Find" or " For Each...Next".
I will not ".Select" the found item.
Any advice much appreciated.
Don



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
Excel lack of compatibility robbiebell22 Excel Discussion (Misc queries) 1 July 23rd 08 01:30 AM
Help with GUI (for lack of a better term) Mike in Saukville Excel Discussion (Misc queries) 1 February 21st 07 09:55 PM
Nice idea lack of knowledge! carnelain Excel Discussion (Misc queries) 3 March 21st 06 07:40 PM
lack of chart uniformity Aja Excel Programming 1 June 17th 04 03:45 AM
On the lack of control arrays. Jan Nordgreen Excel Programming 3 October 11th 03 12:11 AM


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

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

About Us

"It's about Microsoft Excel"