Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default cell reference

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default cell reference

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default cell reference

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default cell reference

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default cell reference

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default cell reference

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nesting a sheet name reference within a cell reference??? Broyston Excel Discussion (Misc queries) 9 July 8th 08 08:35 PM
Changing sheet reference to cell reference TeeJay Excel Worksheet Functions 3 October 19th 07 11:50 AM
absolute cell reference A spreadsheet cell reference that does no help Excel Discussion (Misc queries) 1 January 18th 06 06:56 PM
problem with cell reference in =sum(offset(cell reference,x,y,z,a)). Want cell ref to be variable. [email protected] Excel Worksheet Functions 2 December 11th 04 12:05 AM
Problem with =sum(offset(cell reference,w,x,y,z). I want cell reference to be variable [email protected] Excel Worksheet Functions 2 December 11th 04 12:00 AM


All times are GMT +1. The time now is 07:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"