View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
KC KC is offline
external usenet poster
 
Posts: 55
Default Excel automation: how to employ Find function?

It appears you already found "2340553" in the set statement. Then you loop
through every cell in usedrange to display the time taken.

Am I missing something please?

"fred" wrote in message
...
I do not use vba but visual basic.
I have already created code to search for data, but it is not
instanenous.!
It takes over 20 secs to find the data.
Is that normal?
Below is the code:
==============
Dim c As Range
With moExcelWS.UsedRange
Set c = .Find("2340553")
Start = Timer
For Each c In moExcelWS.UsedRange
If c = "2340553" Then
Debug.Print CStr(Timer - Start)
End If
Next
End With
==============

How can I speed that process? I need to look only in one, preselected
column.
Thanks,
Fred

"JLGWhiz" wrote in message
...
VBA has its own Find method. See the VBA help file.


"fred" wrote in message
...
Hello,
My app written in vbasic uses Excel automation.
How to implement Find function?
I need to check if the same data exists in specified column.
Using Object Browser I've found this:

Function Find(Arg1 As String, Arg2 As String, [Arg3]) As Double
Member of Excel.WorksheetFunction
but that appears to be not part of Excel automation.

Please advise,
Fred