I have spreadsheets with similar codes for the same outcome: Once I click on the cell I register the info in another cell.
Spreadsheet A register the info in the cell C4
Spreadsheet B register the info in the cell C9
However only the code in the spreadsheet A works. I don't know what is wrong with the code in the spreadsheet B
Someone help me please!!!
Spreadsheet 1
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Target_Row = Target.Row
Target_Column = Target.Column
If Target.Count = 1 Then
If (Target_Row = 15) And (Target_Column = 8) Then
Line_Code = Sheets("A").Cells(Target_Row, 8).Text
Sheets("Aux").Range("C4").Value = Line_Code
End If
If (Target_Row = 15) And (Target_Column = 11) Then
Line_Code = Sheets("A").Cells(Target_Row, 11).Text
Sheets("Aux").Range("C4").Value = Line_Code
End If
End If
End Sub
Spreadsheet B
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Target_Row = Target.Row
Target_Column = Target.Column
If Target.Count = 1 Then 'Make sure only one cell is selected
If (Target_Row = 15) And (Target_Column = 9) Then
Line_Code = Sheets("B").Cells(Target_Row, 9).Text
Sheets("Aux").Range("C9").Value = Line_Code
End If
If (Target_Row = 15) And (Target_Column = 15) Then
Line_Code = Sheets("Reclaim").Cells(Target_Row, 15).Text
Sheets("Aux").Range("C9").Value = Line_Code
End If
Application.ScreenUpdating = True
End If
End Sub
Bookmarks