View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default retrieving cell reference data

If you are writing a SUB then

ActiveCell

If you want to create a UDF (User Define function) like you would use on a
worksheet then You will pas the cell(s) that you are using in the function

=MySum(A1:b10_


function MySum(target as range)
MySum = 0
for each cell in target
MySum = MySum + cell.value
next cell

end function


"thomas donino" wrote:

I am new to this so pardon my ignorance. I am trying to write a short macro
but first I need to obtain the row and column info of the cell that is
currently selected. How do I do so?