数值转化Excel列字母的函数

Function mfH00R0_GetExcelCol(intCols As Integer) As String
    Dim strOut As String
    Dim intI As Integer
    If intCols > 0 And intCols <= 255 Then
        If intCols > 26 Then
            strOut = strOut & Chr(Asc("A") - 1 + IIf(intCols Mod 26 = 0, (intCols \ 26) - 1, intCols \ 26))
        End If
        strOut = strOut & Chr(Asc("A") - 1 + IIf(intCols Mod 26 = 0, 26, intCols Mod 26))
    End If
    mfH00R0_GetExcelCol = strOut
End Function
posted @ 2006-07-26 19:22  放飞梦想  阅读(432)  评论(0编辑  收藏  举报