value of the active cell

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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)
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top