Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Help!
I can run this code from inside a simple Macro called subroutine with ARG replaced by a string. But when I put it in another function and call it from within my own code, I get a 424 Error, "Object required" error. And it was running until an hour ago. Anyidea what's going on? Many thanks, Mac Lingo Berkeley, CA ================================================== =========== The Code Range("A1").Select Set rng = Cells.Find(What:=ARG, After:=ActiveCell, LookIn:=xlValues, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False).Activate |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think the find isn't locating the ARG value on the activesheet. this means
then that No Object (a range) has been set and so it can't activate it. try replacing you one liner with these extra lines: Set rng = Cells.Find(What:=ARG, After:=ActiveCell, LookIn:=xlValues, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False) If rng Is Nothing Then MsgBox ARG & " not found on active sheet." Else rng.Activate End If HTH Barry "Mac Lingo" wrote: Help! I can run this code from inside a simple Macro called subroutine with ARG replaced by a string. But when I put it in another function and call it from within my own code, I get a 424 Error, "Object required" error. And it was running until an hour ago. Anyidea what's going on? Many thanks, Mac Lingo Berkeley, CA ================================================== =========== The Code Range("A1").Select Set rng = Cells.Find(What:=ARG, After:=ActiveCell, LookIn:=xlValues, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False).Activate |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Why does this code not work? | Excel Discussion (Misc queries) | |||
Why this code is not work? | Excel Worksheet Functions | |||
vba code doesn't work | Excel Programming | |||
Code Does Not Work | Excel Programming | |||
Code Still Does Not Work | Excel Programming |