grupi
September 12th, 2004, 07:43 AM
Hi all,
I am writing a script that searches an excel sheet for certain phrases (my search is for the exact phrase - for example, if I'm searching for "16" then neither "416" nor "163" will do, only "16"!).
I've recorded a macro with my search parameter:
********** Excel Macro ******************************
Range("A1:E12").Select
Selection.Find(What:="16", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
**************************************************
However, I'm having a lot of problems converting it to vbscript :-(
I can't get my parameters right (I've looked through the table of constants for excel, but even after playing with those I'm still stuck...).
My other option is to use the regular "find" (which is no problem), and then write a small procedure to verify that I have the right information, BUT, being new to vbscript and after being told so many great things about the advantages of vbscript over perl, I have to admint I'de be mighty pissed of if it can't handle a simple thing like this... so I guess it's more a matter of principle....
Can anyone help me with this?
Cheers and beers,
Grupi.
I am writing a script that searches an excel sheet for certain phrases (my search is for the exact phrase - for example, if I'm searching for "16" then neither "416" nor "163" will do, only "16"!).
I've recorded a macro with my search parameter:
********** Excel Macro ******************************
Range("A1:E12").Select
Selection.Find(What:="16", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
**************************************************
However, I'm having a lot of problems converting it to vbscript :-(
I can't get my parameters right (I've looked through the table of constants for excel, but even after playing with those I'm still stuck...).
My other option is to use the regular "find" (which is no problem), and then write a small procedure to verify that I have the right information, BUT, being new to vbscript and after being told so many great things about the advantages of vbscript over perl, I have to admint I'de be mighty pissed of if it can't handle a simple thing like this... so I guess it's more a matter of principle....
Can anyone help me with this?
Cheers and beers,
Grupi.