still learning
Well-known Member
- Joined
- Jan 15, 2010
- Messages
- 821
- Office Version
- 365
- Platform
- Windows
Hi
I'm stuck on how to have a macro copy and paste something without leaving the cell that the cursor is in
after the sheet opens and the cursor lands on the next empty cell in a, I want to copy what is in H above that row to Z1 but i want to stay in that A cell and add input.
I don't know how to keep the cursor in that A cell.
I have:
mike
.....
I'm stuck on how to have a macro copy and paste something without leaving the cell that the cursor is in
after the sheet opens and the cursor lands on the next empty cell in a, I want to copy what is in H above that row to Z1 but i want to stay in that A cell and add input.
I don't know how to keep the cursor in that A cell.
I have:
HTML:
Private Sub Workbook_open()
x = Range("A" & Rows.Count).End(xlUp).Row
Range("A" & x + 1).Select
ActiveWindow.ScrollRow = ActiveCell.Row - 8
Selection.End(xlToRight).Select
ActiveCell.Offset(0, -1).Range("A1").Select
Selection.Copy
' this is where i'm stuck the next line doesn't keep the cursor from moving
Range("z1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Value = Selection.Value
.....
mike
.....