ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find Command (https://www.excelbanter.com/excel-programming/311338-find-command.html)

Adam[_9_]

Find Command
 
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

Frank Kabel

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




All times are GMT +1. The time now is 12:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com