Explain about ADDRESS property

     

  • It returns ADDRESS of a particular cell
  • It is a read only property
  •  

    Write a program to retrieve address of a particular cell on message box where active cell is B2

     

  • Click on B2
  • Then run the program
  •  

     

    Answer

     

    Write a program to write address of a particular cell on specifed range where active cell is B2

     

     

     

    Write a program to define range address through cell property

     

     

     

    Write a program to define range address through SELECTION

     

     

     

     

    ADDRESS property of Active cell

     

    Private Sub CommandButton1_Click()
    'absolute reference which is default
    MsgBox ActiveCell.Address
    'or
    Range("A1") = ActiveCell.Address(True, True)
    Range("A2") = ActiveCell.Address(False, True)
    Range("A3") = ActiveCell.Address(True, False)
    Range("A4") = ActiveCell.Address(False, False)
    End Sub

     

     

    ADDRESS property

     

    Private Sub CommandButton1_Click()
    a = Range("A1").End(xlDown).Address
    MsgBox a
    End Sub