A possible solution is to capture the SelectionChanged event from the DataGridView object.
The issue is that it triggers repeatedly (eg: when a cell is selected, or an entire row, or multiple cells ) so you can limit this action by modifying two properties of the DataGridView: MultiSelect and SelectionMode .
Then the code you should use is this:
Private Sub DataGridView1_SelectionChanged(sender As Object, e As EventArgs) Handles DataGridView1.SelectionChanged
If DataGridView1.SelectedCells.Count <> 0 Then
Dim CodArt As String = DataGridView1.SelectedCells(0).Value.ToString()
End If
End Sub
EDIT:
The code that I programmed in the SelectionChanged event is a "similar" to what you have programmed but that code is wrong if you intend that, moving through a row cell by cell, it is captured a particular column and not every cell.
To put it another way with the code present above you define the variable "CodArt" with the value of the cell you are moving to.
If your intention is to recover the "CodArt" column of the row in which you are, regardless of the cell the code to use is the following:
Private Sub DataGridView1_SelectionChanged(sender As Object, e As EventArgs) Handles DataGridView1.SelectionChanged
If DataGridView1.SelectedCells.Count <> 0 Then
'N de Fila:
Dim NFila As Integer = DataGridView1.SelectedCells(0).RowIndex
'Con el N de Fila, me posiciono y recupero la Columna 'CodArt'
Dim CodArt As String = DataGridView1.Rows(NFila).DataBoundItem("CodArt").ToString
End If
End Sub