Macro ( Move cursor 1 place to the left)

  • Thread starter Thread starter WayneF
  • Start date Start date
W

WayneF

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
 
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.)
 
Thanks David that worked for me !! :D

Dave Peterson said:
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.)
 
Back
Top