View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Refer to the cell in which a function is entered.

Hi
use
application.caller
for this

Note: The return value won't change if you only change the
format of this cell (this won't force a re-calculation)

-----Original 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
.