Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range Find
I am using the Find method of Range.
Do you have to find whole strings of the cell? I am sending in a filename. But my cell contains full path. and it is not finding the cell. For example: Cell: C:\foo\foo\foo\myfile.doc and my code is this: Set objFind = objSheet.Range(strRange).Find(what:=Trim$("myfile. doc"), LookIn:= _ xlFormulas, lookat:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:= _ xlNext, MatchCase:=False) Do you need to find full strings? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range Find
See the VBA help
You can use xlPart -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "greg" wrote in message ... I am using the Find method of Range. Do you have to find whole strings of the cell? I am sending in a filename. But my cell contains full path. and it is not finding the cell. For example: Cell: C:\foo\foo\foo\myfile.doc and my code is this: Set objFind = objSheet.Range(strRange).Find(what:=Trim$("myfile. doc"), LookIn:= _ xlFormulas, lookat:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:= _ xlNext, MatchCase:=False) Do you need to find full strings? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range Find
Take a look in VBA Help for the Find function. Specifically, the
"LookAt" argument... In article , "greg" wrote: I am using the Find method of Range. Do you have to find whole strings of the cell? I am sending in a filename. But my cell contains full path. and it is not finding the cell. For example: Cell: C:\foo\foo\foo\myfile.doc and my code is this: Set objFind = objSheet.Range(strRange).Find(what:=Trim$("myfile. doc"), LookIn:= _ xlFormulas, lookat:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:= _ xlNext, MatchCase:=False) Do you need to find full strings? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range Find
Hi
Substitute LookAt:=xlWhole with LookAt:=xlPart Regards, Per "greg" skrev i meddelelsen ... I am using the Find method of Range. Do you have to find whole strings of the cell? I am sending in a filename. But my cell contains full path. and it is not finding the cell. For example: Cell: C:\foo\foo\foo\myfile.doc and my code is this: Set objFind = objSheet.Range(strRange).Find(what:=Trim$("myfile. doc"), LookIn:= _ xlFormulas, lookat:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:= _ xlNext, MatchCase:=False) Do you need to find full strings? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find Last cell in Range when range is date format | Excel Discussion (Misc queries) | |||
Find End in Undefined Range Select Range Trim | Excel Programming | |||
VBA REQUIRED TO TAKE VALUE FROM EACH CELL FROM A RANGE AND FIND THE VALUE FROM A DIFFERENT RANGE | Excel Programming | |||
Find the POSITION IN A RANGE of text in a string that matches value(s) in a range | Excel Programming | |||
Find dates in a range; then sum values in that range by a criteria | Excel Discussion (Misc queries) |