cell reference

G

Guest

Hi there,

I am using excel 2002. I want to write a macro to copy an area of cells (4
rows by 4 columns) to 1 row down. e.g. source cells A1:D4, then destination
cells be A2:D5.

The starting cell should be the current active cell. Actually the column is
fixed, always A to D, only the row reference need to be refer to the active
cell.
How should the macro be?

Thanks a lot!
Marisa
 
G

Guest

Thanks Claud,
I have tried this but it copy the whole row down. I only want to copy the
area 4 rows by 4 columns (16 cells) down.
Can you advise. Thanks a lot!
Marisa
 
B

Bob Phillips

With ActiveCell
.Resize(4, 4).Cut Destination:=.Offset(1, 0).Resize(4, 4)
End With


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
G

Guest

Dear Bob,
I don't get it. Is it a stand alone macro or should be within other lines?
Thanks,
Marisa
 
D

Dave Peterson

First, do you really mean copy or do you want cut?

If you mean copy:

Option Explicit
Sub testme01()
With ActiveSheet
.Cells(ActiveCell.Row, "A").Resize(4, 4).Copy _
Destination:=.Cells(ActiveCell.Row + 1, "A")
End With
End Sub

Change the .Copy to .Cut if you want that range moved.
 

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