Function Reference


_Excel_ColumnToNumber

Converts the column letter(s) to a number

#include <Excel.au3>
_Excel_ColumnToNumber ( $sColumn )

Parameters

$sColumn The column letter(s) which you want to turn into a number (e.g. "ZZ" to 702)

Return Value

Success: the column number.
Failure: 0 and sets @error.
@error: 1 - $sColumn is not a valid string

Related

_Excel_ColumnToLetter

Example

#include <Excel.au3>
#include <MsgBoxConstants.au3>

; Translate an Excel column letter to the column number
Local $sCol = "YZ"
Local $iNumber = _Excel_ColumnToNumber($sCol)
If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_ColumnToNumber Example 1", "Error converting letter to number." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_ColumnToNumber Example 1", "Letter: " & $sCol & " = Number: " & $iNumber)