Forum Discussion
karlos_gryspeerdt
Aug 24, 2021Copper Contributor
Cell Value
Dear all, I would like to use the content of the active cell in another cell X. So it means that whenever I jump to another active cell, the content should appear in that cell X. Can that be don...
- Aug 24, 2021
Let's say that cell X is A1.
Right-click the sheet tab.
Select 'View Code' from the context menu.
Copy the following code into the worksheet module:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Me.Range("A1").Value = ActiveCell.Value End SubSwitch back to Excel.
Save the workbook as a macro0enabled workbook (.xlsm).
Make sure that you allow macros when you open the workbook.
HansVogelaar
Aug 24, 2021MVP
Let's say that cell X is A1.
Right-click the sheet tab.
Select 'View Code' from the context menu.
Copy the following code into the worksheet module:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Me.Range("A1").Value = ActiveCell.Value
End Sub
Switch back to Excel.
Save the workbook as a macro0enabled workbook (.xlsm).
Make sure that you allow macros when you open the workbook.
karlos_gryspeerdt
Aug 24, 2021Copper Contributor