View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming,comp.apps.spreadsheets
Phil Bewig Phil Bewig is offline
external usenet poster
 
Posts: 6
Default Run-time error '424': Object required

"Chip Pearson" wrote in message ...
Phil,

Change
ReColorDeps (C)
to
ReColorDeps C

In general, you never want to use parentheses when passing
arguments to Sub procedures.


Sub ColorDeps2()
Dim C As Range
For Each C In Selection
C.Interior.ColorIndex = 4 'green
If HasDependents(C) Then
ReColorDeps (C)
End If
Next C
End Sub


Of course. I knew that. But I've spent more time lately
programming other languages than VBA, and I simply couldn't
see that error no matter how long I looked at it.

Thanks for the quick answer.

Phil