shift and down keys in macro

C

CousinExcel

Hi,
I want to mark four cells.
How can I write shift+down+down+down in a macro.
(Then I say copy paste etc).
Thanks
Cousin Excel
 
J

Jacob Skaria

Activecell.Resize(4).Select
Activecell.Resize(4).Copy

OR starting from cell A1 copy 4 cells to the same sheet cell J1

Range("A1").Resize(4).Copy Range("J1")
 
C

CousinExcel

Hi and thank you Jacob Skaria.
This was something new for me and thank you.
I still need to use shift and down keys.
I hope shift and down keys will solve my probem. There are filtered cells
and when I say things other than shift and down keys it is copying hidden
(filtered away) cells I believe but I need to copy only four cells I see on
screen after filtering.
 
D

Don Guillett

This will find the last row in the active column

Sub shiftdowndowndown()
ar = ActiveCell.Row
ac = ActiveCell.Column
'MsgBox ac
lr = Cells(Rows.Count, ac).End(xlUp).Row
'MsgBox lr
Cells(ar, ac).Resize(lr).Copy
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top