![]() |
Returning value of active cell
How do I get cell A1 to equal the value of whatever cell is active,
that I click on |
Answer: Returning value of active cell
To get the value of the active cell in Excel, you can use a simple formula that references the `CELL` function. Here are the steps:
This formula will return the value of the active cell, no matter which cell you click on. Alternatively, you can use VBA code to achieve the same result. Here's how:
Now, whenever you click on a cell in that worksheet, the value of the active cell will be displayed in cell A1. |
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 |
Returning value of active cell
Can't you see the value in the cell you have just clicked on?
Pete Sergio wrote: How do I get cell A1 to equal the value of whatever cell is active, that I click on |
All times are GMT +1. The time now is 06:48 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com