Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default Select Range every 20 rows copy & paste special

Hi -

I am trying to build a macro that will select the same sized range G45:T48 then copy, paste special then go down 20 rows and do the same thing. Below is some code I started. I am not good with the Do While or Do Until type functions. Can someone point me in the right direction. I need this to go down to row 2000.

Range("G45:T48").Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Range("G65:T68").Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Thanks, Adam
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Select Range every 20 rows copy & paste special

Use the activecell.offset(r,c) function. where r is the
number of rows below the active cell to drop down, and c
is the number of columns along to move. If the columns
are always the same then use 0 for c.

Another way is to use the cells reference to select the
range, so:

Loop until (whatever the criteria is for running this
routine)[An alternative is to do a for a=1 to (however
many times you need this to run)]
With ActiveSheet
.Range(.Cells(row1, 1), .Cells(rownum + 1, 39)).Select
End With
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

row1=row1+20

rownum=rownum+20

end loop [alternative next a]

Best of Luck

DavidC
-----Original Message-----
Hi -

I am trying to build a macro that will select the same

sized range G45:T48 then copy, paste special then go down
20 rows and do the same thing. Below is some code I
started. I am not good with the Do While or Do Until type
functions. Can someone point me in the right direction.
I need this to go down to row 2000.

Range("G45:T48").Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues,

Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Range("G65:T68").Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues,

Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Thanks, Adam
.

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
Select range then copy rows macro noggins Excel Discussion (Misc queries) 1 October 18th 09 11:06 PM
A macro to copy & paste many rows (a range) to the next column .. genehunter New Users to Excel 11 April 21st 09 07:36 AM
Copy range in macro using paste special values Jeff Excel Discussion (Misc queries) 2 August 20th 07 08:12 PM
PASTE LINK option not available when I select PASTE SPECIAL to link an image in Excel to a Word document. tln Links and Linking in Excel 0 April 22nd 07 04:28 PM
How to copy&paste a variable range rows and colums IK Excel Discussion (Misc queries) 1 August 30th 06 12:06 AM


All times are GMT +1. The time now is 05:33 PM.

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

About Us

"It's about Microsoft Excel"