Convert cells(1,1) into “A1” and vice versa

前端 未结 1 1362
灰色年华
灰色年华 2020-12-07 16:39

I am working on an worksheet generator in Excel 2007. I have a certain layout I have to follow and I often have to format cells based on input. Since the generator is dynami

相关标签:
1条回答
  • 2020-12-07 17:05

    The Address property of a cell can get this for you:

    MsgBox Cells(1, 1).Address(RowAbsolute:=False, ColumnAbsolute:=False)
    

    returns A1.

    The other way around can be done with the Row and Column property of Range:

    MsgBox Range("A1").Row & ", " & Range("A1").Column
    

    returns 1,1.

    0 讨论(0)
提交回复
热议问题