How do I get a range's address including the worksheet name, but not the workbook name, in Excel VBA?

前端 未结 11 1468
眼角桃花
眼角桃花 2020-12-25 10:34

If I have a Range object--for example, let\'s say it refers to cell A1 on a worksheet called Book1. So I know that calling Address()

11条回答
  •  梦毁少年i
    2020-12-25 11:20

    Dim rg As Range
    Set rg = Range("A1:E10")
    Dim i As Integer
    For i = 1 To rg.Rows.Count
    
        For j = 1 To rg.Columns.Count
        rg.Cells(i, j).Value = rg.Cells(i, j).Address(False, False)
    
        Next
    Next
    

提交回复
热议问题