ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find Method with list (https://www.excelbanter.com/excel-programming/378702-find-method-list.html)

[email protected]

Find Method with list
 
I'm trying to use the find method in a With statement and in the Find
arguments use a list. Can I do this? If so what is the correct list
separator"

I'm trying:

With ActiveSheet.Rows(1)
Set c = .Find(["CODE","CONFIG"], LookIn:=xlValues)

Set c = .Find("CODE","CONFIG", LookIn:=xlValues)

Etc and cant seem to get ti to work, the code that follows activates
the location of the find but what I try the lists, the activated cell
seems random, and not the actual location of the cell with the variable
in it.

Thanks
Robert


Dave Peterson

Find Method with list
 
I think you'll have to do multiple .find's.

..Find in code (or even edit|Find in excel) doesn't support this kind of thing.)

wrote:

I'm trying to use the find method in a With statement and in the Find
arguments use a list. Can I do this? If so what is the correct list
separator"

I'm trying:

With ActiveSheet.Rows(1)
Set c = .Find(["CODE","CONFIG"], LookIn:=xlValues)

Set c = .Find("CODE","CONFIG", LookIn:=xlValues)

Etc and cant seem to get ti to work, the code that follows activates
the location of the find but what I try the lists, the activated cell
seems random, and not the actual location of the cell with the variable
in it.

Thanks
Robert


--

Dave Peterson

[email protected]

Find Method with list
 
Thanks Dave, thats what I did but just wanted to make sure I wasnt
being sloppy.
Robert

Dave Peterson wrote:
I think you'll have to do multiple .find's.

.Find in code (or even edit|Find in excel) doesn't support this kind of thing.)

wrote:

I'm trying to use the find method in a With statement and in the Find
arguments use a list. Can I do this? If so what is the correct list
separator"

I'm trying:

With ActiveSheet.Rows(1)
Set c = .Find(["CODE","CONFIG"], LookIn:=xlValues)

Set c = .Find("CODE","CONFIG", LookIn:=xlValues)

Etc and cant seem to get ti to work, the code that follows activates
the location of the find but what I try the lists, the activated cell
seems random, and not the actual location of the cell with the variable
in it.

Thanks
Robert


--

Dave Peterson




All times are GMT +1. The time now is 02:43 PM.

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