#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,345
Default Looping Macro

Glad to help. Thanks for the feedback.

--

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Jase" wrote in message
...
This is exactly what I need. Thank you.

"Sandy Mann" wrote:

Try something like:

Sub Test()
p = 10 '<- Change to the number of Rows
'you want to go down before pasting

Application.ScreenUpdating = False

For r = 23 To 323 Step 50
Range("S" & r & ":U" & r).Copy
Range("S" & r + p).PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Next r

Application.ScreenUpdating = True
End Sub


--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Jase" wrote in message
...
This does not work. It is only copying the starting range scrolling
down
and
pasting it and then copying the same data and scrolling another 50
cells
and
pasting it again. I need it to grab range S23:U23 copy scroll down like
10
rows paste scroll down another 50 from the initial S23:U23. So we r now
at
S73 copy this date scroll down 10 rows from here and paste that data.
Then
go
dow to S123 copy that data scroll down 10 and paste and so on and so
on.
"Mike H" wrote:

Possibly

Sub Stitution()
For x = 23 To 73 Step 50
Range("S" & x & ":U" & x).Select
Application.CutCopyMode = False
Selection.Copy
Range("S" & x + 50).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Next
End Sub

Mike

"Jase" wrote:

I have recorded a macro that selects a certain range then pastes
into a
certain range then scrolls down about 50 cells and does the same
thing.
Is
there a way to loop this instead of always selecting particular
ranges?

example of macro....

Range("S23:U23").Select
Application.CutCopyMode = False
Selection.Copy
Range("S63").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("S73:U73").Select
Application.CutCopyMode = False
Selection.Copy
Range("S123").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False







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
Macro looping endlessly Sandy Excel Worksheet Functions 6 May 10th 07 03:48 PM
Excel Macro Looping Helps Jurassien Excel Discussion (Misc queries) 9 February 10th 07 12:44 AM
Looping macro RK Excel Worksheet Functions 2 December 12th 06 11:29 PM
Looping a macro Sony Excel Discussion (Misc queries) 3 October 30th 06 11:52 AM
Macro looping problem. [email protected] Excel Discussion (Misc queries) 8 October 26th 06 02:44 PM


All times are GMT +1. The time now is 12:57 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"