View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 234
Default Refer to the cell in which a function is entered.

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 advanc
Ro

Function CountSameColour(MyRange as excel.range
for each cell in myrang
if cell.interior.colorindex={{{{{{{{this cell}}}}}}}}.interior.colorindex the
countsamecolour=countsamecolour+
end i
nex
End Function