Thread: Find Command
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Find Command

Hi
have a look in the VBA help for .find

--
Regards
Frank Kabel
Frankfurt, Germany

"Adam" schrieb im Newsbeitrag
...
What is the programming for the find command in visual
basic? I want to find a cell that contains the same
value as another cell. I want to know the row number of
the cell. This is what I have but it is way too slow. I
think that if I use the find command instead of Do until
it will be much faster. Thank you

(i is the counter in wks_A)
(n is the counter in wks_S)

For i = 2 To ArcviewFinalRow

n = 2

Do Until (wks_A.Range("B" & i).Value = wks_S.Range("B" &
n).Value Or n = SectionsFinalRow)

n = n + 1
Loop

wks_A.Range("C" & i).Value = wks_S.Range("C" & n).Value

Next i