View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Returning value of active cell

One way:

In your worksheet code module (right-click the worksheet tab and
choose View Code), enter

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
On Error Resume Next
Application.EnableEvents = False
Range("A1").Value = ActiveCell.Value
Application.EnableEvents = True
On Error GoTo 0
End Sub

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = ActiveCell.Address Then
On Error Resume Next
Application.EnableEvents = False
Range("A1").Value = ActiveCell.Value
Application.EnableEvents = True
On Error GoTo 0
End If
End Sub


In article . com,
"Sergio" wrote:

How do I get cell A1 to equal the value of whatever cell is active,
that I click on