This code identifies the ActiveCell and sends the value of that cell to "I6". With the change of the values that appear in "I6", the corresponding photographs of the students will change.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("I6").Value = ActiveCell.Value
End Sub
I get the value of the cell to appear in "I6" whenever I click on a cell in the table. As long as I click on the "I" column where the student numbers are.
The problem appears when I click on any other table cell ("I14:X43") outside this "I" column.
I need the code to always identify column "I" (I4:I43) of the active cell row.
Thus, whenever you are entering a record in any cell of the table ("I14:X43"), the code will identify the column "I" of that line and its value (student number). Identifying the value found in column "I" of the active cell row, it will appear in "I6", as it is in this formula and was changing the students' photographs.
At this moment, when I write a value inside the table, it will be this value that will appear in "I6" carrying a photograph that corresponds to the value that was registered/written and not to the number of the student of the line where I am.
A friend helped me with this code. It works up to column "Z".
Sub_ Selectionchange
Dim x As String
Dim and As String
x = ActiveCell.Address(0, 0)
y = WorksheetFunction.Replace(x, 1, 1, "=I")
Range("I6").Value = y
End Sub
Clicking after that "Z" column, the code stops working and 0 appears in the "I6" column.
Trying to send the column "I" value of the ActiveCell row to cell "I6".

Use the ActiveCell row and always use 9 => "I" column with Cells to get the value in column I in the same row of ActiveCell