Как определить буквенное обозначение столбца
Категория: Basic
2012-12-27 17:32:10
code: #vba
iClmIndex = ActiveCell.Column iAddress = ActiveCell.Address iColumn = Mid(iAddress, 2, IIf(iClmIndex > 26, 2, 1))
code: #vba
iClmIndex = ActiveCell.Column iAddress = ActiveCell.Address(RowAbsolute:=False, ColumnAbsolute:=False) iColumn = Left(iAddress, IIf(iClmIndex > 26, 2, 1))
code: #vba
iAddress = ActiveCell.EntireColumn.Address(ColumnAbsolute:=False) iPosition = InStr(iAddress, ":") - 1 iColumn = Left(iAddress, iPosition)
code: #vba
iClmIndex = ActiveCell.Column Select Case iClmIndex Case 1 To 26 iColumn = Chr(64 + iClmIndex) Case 27 To 256 iColumn = Chr(64 + (iClmIndex \ 26)) & _ Chr(64 + iClmIndex - (iClmIndex \ 26) * 26) End Select
code: #vba
iClmIndex = ActiveCell.Column If iClmIndex < 27 Then iColumn = Chr(64 + iClmIndex) Else iColumn = Chr(64 + (iClmIndex \ 26)) & _ Chr(64 + iClmIndex - (iClmIndex \ 26) * 26) End If
Поделиться: