Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Frank:
Thank for your help. I tried this, but I receive an error 91 on the Set statement. Any ideas what I might be doing wrong? Thanks, Mike. p.s. There is something wrong with the posting ... I cannot find the previous posting unless I do a search. ------------------- Hi Mike try Set OFound = Cells.Find(What:=mydate, After:=ActiveCell, LookIn:= _ xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _ xlNext, MatchCase:=False, SearchFormat:=False).Activate If Not oFound Is Nothing Then oFound.activate else msgbox "not found" End If |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Mike,
The Find method returns a Range type object, which you can either Set to the variable OFound, or use with Activate. You can't do both. Get rid of the Activate method at the end of that line of code: Set OFound = Cells.Find(What:=mydate, After:=ActiveCell, LookIn:= _ xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _ xlNext, MatchCase:=False, SearchFormat:=False) -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com wrote in message ... Frank: Thank for your help. I tried this, but I receive an error 91 on the Set statement. Any ideas what I might be doing wrong? Thanks, Mike. p.s. There is something wrong with the posting ... I cannot find the previous posting unless I do a search. ------------------- Hi Mike try Set OFound = Cells.Find(What:=mydate, After:=ActiveCell, LookIn:= _ xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _ xlNext, MatchCase:=False, SearchFormat:=False).Activate If Not oFound Is Nothing Then oFound.activate else msgbox "not found" End If |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Chip and Frank! I understand this now.
Mike. -----Original Message----- Mike, The Find method returns a Range type object, which you can either Set to the variable OFound, or use with Activate. You can't do both. Get rid of the Activate method at the end of that line of code: Set OFound = Cells.Find(What:=mydate, After:=ActiveCell, LookIn:= _ xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _ xlNext, MatchCase:=False, SearchFormat:=False) -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com wrote in message ... Frank: Thank for your help. I tried this, but I receive an error 91 on the Set statement. Any ideas what I might be doing wrong? Thanks, Mike. p.s. There is something wrong with the posting ... I cannot find the previous posting unless I do a search. ------------------- Hi Mike try Set OFound = Cells.Find(What:=mydate, After:=ActiveCell, LookIn:= _ xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _ xlNext, MatchCase:=False, SearchFormat:=False).Activate If Not oFound Is Nothing Then oFound.activate else msgbox "not found" End If . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excell copy action pauses for 15 second for the smallest action | Excel Discussion (Misc queries) | |||
Allow no action to be taken | Excel Worksheet Functions | |||
what is OLE.action | Excel Discussion (Misc queries) | |||
Action on error | Excel Programming | |||
Error msg "Microsoft Excel is waiting for another application to complete an OLE action" | Excel Programming |