Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have this code and 2 problems; Sheets("calendar").Activate Dim foundcell As Range Dim this this = activecell.Value Debug.Print this Set foundcell = cells.find(what:=this, After:=activecell, LookIn:=xlFormulas, LookAt _ :=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ True) If foundcell Is Nothing Then foundcell.Activate As a test i have typed cow in 2 cells, and run the code with the first "cow" cell selected. The code errors on the foundcell.activate, run time error '91', object variable or with block variable not set. It is obviously finding the second "cow" but will not select it. My second problem is if i change the cell vaues from cow to dates eg, 01/01/2008 the find does not work at all. Thanks, |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Apologies, I have adjusted my code so it is now correct and I no
longer get the error; * * *If not foundcell Is Nothing Then * * *foundcell.Activate However why is my find not finding?! I can see plain as day the values are there however it is not finding them. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It is possible that the setting MatchCase:= True could be the culprit. If
your What is not the same case as the target cells, then it will not return them. "anon" wrote: Apologies, I have adjusted my code so it is now correct and I no longer get the error; If not foundcell Is Nothing Then foundcell.Activate However why is my find not finding?! I can see plain as day the values are there however it is not finding them. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error dialog box meaning and how to find error | Excel Worksheet Functions | |||
Find error!!!! Is there any other way to do this? | Excel Programming | |||
Find error!!!! Is there any other way to do this? | Excel Programming | |||
help with this error-Compile error: cant find project or library | Excel Discussion (Misc queries) | |||
change error message when no more for "find" in macro to find | Excel Programming |