View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Refer to the cell in which a function is entered.

Application.Caller

--
Regards,
Tom Ogilvy

"Rob" wrote in message
...
My function points to a range, and I want it to count all the cells in the

range that are the same colour as the cell in which the function is entered.
How can I refer to the cell?
Thanks in advance
Rob

Function CountSameColour(MyRange as excel.range)
for each cell in myrange
if cell.interior.colorindex={{{{{{{{this

cell}}}}}}}}.interior.colorindex then
countsamecolour=countsamecolour+1
end if
next
End Function