How do I do this please?
So I press Ctrl & C, the cell copies and then shifts two to the left - also when i press CTRL & V, it pastes then shifts one to the right.
Thanks.
Printable View
How do I do this please?
So I press Ctrl & C, the cell copies and then shifts two to the left - also when i press CTRL & V, it pastes then shifts one to the right.
Thanks.
[vba]
Sub CopyAndMove()
With ActiveCell
.Copy
If .Column >= 3 Then
.Offset(0, -2).Select
ElseIf .Column >= 2 Then
.Offset(0, -1).Select
End If
End With
End Sub
Sub PasteAndMove()
With ActiveSheet
.Paste
If ActiveCell.Column <= .Columns.Count - 1 Then
ActiveCell.Offset(0, 1).Select
End If
Application.CutCopyMode = False
End With
End Sub
Sub SetKeys()
Application.OnKey "^c", "CopyAndMove"
Application.OnKey "^v", "PasteAndMove"
End Sub
[/vba]
The first two do the work, the third setsup the control keys.
Marvellous,
Thanks Mr X
Don't forget to reset the keys when done!