value of the active cell

C

caroline

Is there a function that would allow me to get the value of the active cell?
like it is done in VBA: Activecell.value
thanks
 
B

Bob Phillips

Not a function, worksheet functions do not know what the active cell is, you
need event code for this

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Me.Range("H10").Value = ActiveCell.Value
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
C

caroline

Thanks That is what I thought.

--
caroline


Bob Phillips said:
Not a function, worksheet functions do not know what the active cell is, you
need event code for this

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Me.Range("H10").Value = ActiveCell.Value
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Top