Vind kolomletter

We geven een zoekterm op en willen de kolomletter vinden waarin deze zoekterm zich bevindt. Laten we zoeken naar:

San Cristóbal

Vul die naam in onderstaande code in.

Sub Find_Column_Letter()
    Set cell = Cells.Find("San Cristóbal", , xlValues, xlPart, , , False)
    If Not cell Is Nothing Then
      ColLetter = Split(cell.Address, "$")(1)
      MsgBox ColLetter
    Else
      MsgBox "I cannot find that text on this sheet"
    End If
End Sub

De uitkomst is kolom E

Je kunt natuurlijk ook gewoon zoeken met toetscombinatie Ctrl+F en in het zoekvak de naam invullen.

Leave a Reply

Your email address will not be published. Required fields are marked *