Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
using find method after using it earlier
I use the find method to find a cell. I copy the contents of the
cells. Later I use the find method to find a different string. At this point it find the first string or sometimes gives me an error that object not found. Any ideas. Is there a way to clear a register hold the first string? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
using find method after using it earlier
I can't see you code, but it could be that you don't set all the options or
you could be searching after the activecell and that isn't located where you think. Sub SubFindIt() sStr = "ABC" Set rng = Cells.Find(What:=sStr, _ After:=Range("IV65536"), _ LookIn:=xlFormulas, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) If Not rng Is Nothing Then MsgBox sStr & " found at " & rng.Address Else MsgBox sStr & " not found" End If End Sub would be a good way to do the search. Obviously, consult the help on find and adjust the arguments to meet your needs. Also, I assume you are using Find and not FindNext. You wouldn't want to use findnext if you are changing what you are searching for. -- Regards, Tom Ogilvy "rub" wrote in message ups.com... I use the find method to find a cell. I copy the contents of the cells. Later I use the find method to find a different string. At this point it find the first string or sometimes gives me an error that object not found. Any ideas. Is there a way to clear a register hold the first string? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
using find method after using it earlier
when your'e using this Find command is there a way to copy what your looking
for plus the eight cells next to the word? Tom Ogilvy wrote: I can't see you code, but it could be that you don't set all the options or you could be searching after the activecell and that isn't located where you think. Sub SubFindIt() sStr = "ABC" Set rng = Cells.Find(What:=sStr, _ After:=Range("IV65536"), _ LookIn:=xlFormulas, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) If Not rng Is Nothing Then MsgBox sStr & " found at " & rng.Address Else MsgBox sStr & " not found" End If End Sub would be a good way to do the search. Obviously, consult the help on find and adjust the arguments to meet your needs. Also, I assume you are using Find and not FindNext. You wouldn't want to use findnext if you are changing what you are searching for. I use the find method to find a cell. I copy the contents of the cells. Later I use the find method to find a different string. At this point it find the first string or sometimes gives me an error that object not found. Any ideas. Is there a way to clear a register hold the first string? -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200610/1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I find and reopen an excel file I created earlier? | Excel Discussion (Misc queries) | |||
date find using find method | Excel Programming | |||
Using variables to make a date and using find method to find that. | Excel Programming | |||
Find method | Excel Programming | |||
The Find Method | Excel Programming |