Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
using search function in VBA
Hi,
I'm very new to VBA. sorry for asking dumb question. I'm trying to do the below and it is not working. x = 500 Do While Cells(x, 2).Value < "" y = 100 Do While Cells(y, 5).Value < "" if worksheetfunction.search(cells(x, 2), cells(y, 5)) 0 then ' do something end if y = y + 1 loop x = x + 1 loop Here I want to search the text string of each cell from one range into another range. How do I do this. The above code compiles fine. But I'm getting a runtime error on the line "if worksheetfunction.search(cells(x, 2), cells(y, 5)) 0 then". Looks like the search function can not take variable such as x and y. Thanks for any help! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
SEARCH Function | Excel Discussion (Misc queries) | |||
SEARCH function | Excel Programming | |||
Search Function | Excel Discussion (Misc queries) | |||
search function | New Users to Excel | |||
search function | Excel Programming |