+ Reply to Thread
Results 1 to 3 of 3

Macro ( Move cursor 1 place to the left)

  1. #1
    WayneF
    Guest

    Macro ( Move cursor 1 place to the left)


    Hi all,

    The user selects anywhere in excel Say B:1 to B:5.

    Then they execute the macro I have written to copy this information to a
    given area in another work book. This works fine.

    What I would then like to happen is the initial selection area to move 1
    colum to the left (In this case A:1) and copy this cell and then paste this
    somewhere else.

    I tried by simply moving the cursor but it actually enters A:1 into the
    macro.

    What I want is that A:1 becomes a veriable depending upon the initial
    selection. IE ( User started at B10 to B:20) Then I need to copy A:10 to
    somewhere else.

    Can anyone help me on the code side ? How to i get the cursor to move to
    the left without entering a cell number ?

    Cheers,

    Wayne



  2. #2
    Dave Peterson
    Guest

    Re: Macro ( Move cursor 1 place to the left)

    Without seeing your code....

    If you used Activecell to copy|paste the selection, you can use:

    activecell.offset(0,-1)
    to go to the cell one column to the right.

    activecell.copy _
    destination:=worsheets("sheet2").range("b1")

    activecell.offset(0,-1).copy _
    destination:=worksheets("sheet3").range("x99")

    (I had no idea where to paste.)

    WayneF wrote:
    >
    > Hi all,
    >
    > The user selects anywhere in excel Say B:1 to B:5.
    >
    > Then they execute the macro I have written to copy this information to a
    > given area in another work book. This works fine.
    >
    > What I would then like to happen is the initial selection area to move 1
    > colum to the left (In this case A:1) and copy this cell and then paste this
    > somewhere else.
    >
    > I tried by simply moving the cursor but it actually enters A:1 into the
    > macro.
    >
    > What I want is that A:1 becomes a veriable depending upon the initial
    > selection. IE ( User started at B10 to B:20) Then I need to copy A:10 to
    > somewhere else.
    >
    > Can anyone help me on the code side ? How to i get the cursor to move to
    > the left without entering a cell number ?
    >
    > Cheers,
    >
    > Wayne


    --

    Dave Peterson

  3. #3
    WayneF
    Guest

    Re: Macro ( Move cursor 1 place to the left)

    Thanks David that worked for me !! :D

    "Dave Peterson" <[email protected]> wrote in message
    news:[email protected]...
    > Without seeing your code....
    >
    > If you used Activecell to copy|paste the selection, you can use:
    >
    > activecell.offset(0,-1)
    > to go to the cell one column to the right.
    >
    > activecell.copy _
    > destination:=worsheets("sheet2").range("b1")
    >
    > activecell.offset(0,-1).copy _
    > destination:=worksheets("sheet3").range("x99")
    >
    > (I had no idea where to paste.)
    >
    > WayneF wrote:
    >>
    >> Hi all,
    >>
    >> The user selects anywhere in excel Say B:1 to B:5.
    >>
    >> Then they execute the macro I have written to copy this information
    >> to a
    >> given area in another work book. This works fine.
    >>
    >> What I would then like to happen is the initial selection area to
    >> move 1
    >> colum to the left (In this case A:1) and copy this cell and then paste
    >> this
    >> somewhere else.
    >>
    >> I tried by simply moving the cursor but it actually enters A:1 into
    >> the
    >> macro.
    >>
    >> What I want is that A:1 becomes a veriable depending upon the initial
    >> selection. IE ( User started at B10 to B:20) Then I need to copy A:10 to
    >> somewhere else.
    >>
    >> Can anyone help me on the code side ? How to i get the cursor to move
    >> to
    >> the left without entering a cell number ?
    >>
    >> Cheers,
    >>
    >> Wayne

    >
    > --
    >
    > Dave Peterson




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1