Comment convertir un nom de colonne Excel (comme ‘AA’) en numéro de colonne ?
En formule :
=COLONNE(INDIRECT(A1&"1"))
(où A1 contient la lettre de colonne)
En VBA :
Function LettreVersNum(lettre As String) As Long
LettreVersNum = Range(lettre & "1").Column
End Function
En Python :
from openpyxl.utils import column_index_from_string
num = column_index_from_string('AA') # 27