Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
sub rowins()
activesheet.rows(1).insert shift:=xldown end sub *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 "Claud Balls" wrote: sub rowins() activesheet.rows(1).insert shift:=xldown end sub *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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) "Marisa" wrote in message ... 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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dear Bob,
I don't get it. Is it a stand alone macro or should be within other lines? Thanks, Marisa "Bob Phillips" wrote: 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) "Marisa" wrote in message ... 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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. Marisa wrote: 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 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Nesting a sheet name reference within a cell reference??? | Excel Discussion (Misc queries) | |||
Changing sheet reference to cell reference | Excel Worksheet Functions | |||
absolute cell reference A spreadsheet cell reference that does no | Excel Discussion (Misc queries) | |||
problem with cell reference in =sum(offset(cell reference,x,y,z,a)). Want cell ref to be variable. | Excel Worksheet Functions | |||
Problem with =sum(offset(cell reference,w,x,y,z). I want cell reference to be variable | Excel Worksheet Functions |