Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I tried
Dim mrngPrecedents As Range On Error Resume Next Set mrngPrecedents = Selection.DirectPrecedents But I still get the same error Użytkownik "Jim Thomlinson" napisał w wiadomości ... I would be inclined to do it this way... dim rngPrecedents as range on error resume next set rngPrecedents = Selection.DirectPrecedents on error goto 0 if rngPrecedents is nothing then msgbox "sorry no precedents" else rngPrecedents.select end if It is a bit longer than Don's code (which works) but it does not leave you in an error handler. My preference is to avoid errors were possible. If I have to generate an error I try to dismiss it as soon as possible and resume normal execution. -- HTH... Jim Thomlinson "IgorM" wrote: Hi When my macro tries to run the line below if the selected cell has no formulas i get a runtime error 1004 - no cells were found. How to get around this? Selection.DirectPrecedents.Select Kind regards Igor |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
runtime error '1004' application or object defined error | Excel Programming | |||
runtime error '1004' application or object defined error. Please help | Excel Programming | |||
Runtime Error 1004 | Excel Programming | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
What is RunTime Error '1004'? | Excel Programming |