Forum Discussion
VBA requirement
Replace your VBA code with this.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim targetSheet As Worksheet
Dim clickedCellValue As Variant
Dim adjacentCellValue As Variant
' Check if the clicked cell is A3
If Not Intersect(Target, Me.Range("A3")) Is Nothing Then
' Set the target sheet to Sheet2
Set targetSheet = ThisWorkbook.Worksheets("Sheet2")
' Get the clicked cell value and its adjacent cell value
clickedCellValue = Target.Value
adjacentCellValue = Target.Offset(0, 1).Value
' Redirect to Sheet2
targetSheet.Activate
' Display the values in Sheet2
targetSheet.Range("A1").Value = clickedCellValue
targetSheet.Range("B1").Value = adjacentCellValue
End If
End Sub