View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Highlight the cells referenced in the active cell formula

If you want to give up Undo, colored cells, and the ability to paste on the
sheet, in the selectonchange event, you could write code to uncolor all
cells, then use the Target(1).DirectPrecedents to color the cells.

Demoing directprecedents from the immediate window.

? activecell.Formula
=SUM(B2+C3+G6)
? activecell.DirectPrecedents.Address
$B$2,$C$3,$G$6

--
Regards,
Tom Ogilvy


"Charles" wrote:

I want to have the cells that are referenced in the active cells formula
highlight. For example if I have column A cell 1 with a formula of
=sum(b2+c3+g6) I would like for the cells b2, c3, g6 to highlight yellow. The
formula changes for each cell as do the referenced cells. Does anyone know if
this is possible?