I am unable to move down in excel cells by VB code

I need to move by two cells down in excel by writing a code in visual basic by the click of a cammand button

Example: Now I am in cell A10 and I need to be moved by two cells down by pressing a cammand button. That is after clicking the cammand button My active cell should be cell A12.




Answer this question

I am unable to move down in excel cells by VB code

  • Squid Dog

    Thanks PSHK The codes given by you are perfect for my programme and I found it works the way I expected.

    Regards...

    Ajamilan



  • Yulia

    Try the following

    Sub X()
    Dim rngCurrent As Range
    Set rngCurrent = ActiveCell

    ActiveSheet.Cells(rngCurrent.Row + 2, rngCurrent.Column).Select

    End Sub



  • Arshu

    Sub Y()
    ActiveCell.Offset(2).Select
    End Sub

    - Jon
    -------
    Jon Peltier, Microsoft Excel MVP
    Tutorials and Custom Solutions
    http://PeltierTech.com
    _______



  • I am unable to move down in excel cells by VB code