Get Excel Range ColumnThis is a featured page

Private Function Column(ByVal vlngX As Long) As String
' Returns an Execl range column like "A".
' EX: objSheet.Columns(Column(1) & ":" & Column(10)).Select
' 1 <= vlngX <= 676
' 1 <= vlngY
Dim strColumn As String

strColumn = Chr(Asc("A") + ((vlngX - 1) Mod 26))
If vlngX > 26 Then
strColumn = Chr(Asc("A") + Fix(vlngX / 26) - 1) & strColumn
End If
Column = strColumn
End Function


No user avatar
2buck
Latest page update: made by 2buck , Dec 1 2006, 11:49 PM EST (about this update About This Update 2buck Edited by 2buck


view changes

- complete history)
Keyword tags: None (edit keyword tags)
More Info: links to this page

Anonymous  (Get credit for your thread)


There are no threads for this page.  Be the first to start a new thread.