Function to convert column number to letter?

后端 未结 28 1806
灰色年华
灰色年华 2020-11-22 07:04

Does anyone have an Excel VBA function which can return the column letter(s) from a number?

For example, entering 100 should return CV.

28条回答
  •  长情又很酷
    2020-11-22 07:54

    Easy way to get the column name

    Sub column()
    
    cell=cells(1,1)
    column = Replace(cell.Address(False, False), cell.Row, "")
    msgbox column
    
    End Sub
    

    I hope it helps =)

提交回复
热议问题