Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 304
Default I need a simple loop with a 4+ row added in.

I have simple macro but I'm not that good with VB code. This is what I have:
ActiveCell.FormulaR1C1 = "=RC[-25]"
Range("AC10").Select
ActiveCell.FormulaR1C1 = "=RC[-25]"
Range("AD10").Select
ActiveCell.FormulaR1C1 = "=RC[-24]"
Range("AE10").Select
ActiveCell.FormulaR1C1 = "=RC[-21]"
Range("AF10").Select
ActiveCell.FormulaR1C1 = "=R[1]C[-22]"
Range("AG10").Select
ActiveCell.FormulaR1C1 = "=R[2]C[-23]"
Range("AH10").Select
ActiveCell.FormulaR1C1 = "=R[3]C[-24]"
Range("AB10:AH10").Select
Selection.Copy
Range("AB14").Select
ActiveSheet.Paste
Range("AB18").Select
ActiveSheet.Paste
Range("AB22").Select
ActiveSheet.Paste
Range("AB26").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("AB10").Select
End Sub

What I like to do is run a loop. From the start point, I move down 4 rows
and paste my function and then I go down 4 rows and paste.
Thanks


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,311
Default I need a simple loop with a 4+ row added in.

This will repeat your pasting loop 10 times. Adjust as needed.

ActiveCell.FormulaR1C1 = "=RC[-25]"
Range("AC10").Select
ActiveCell.FormulaR1C1 = "=RC[-25]"
Range("AD10").Select
ActiveCell.FormulaR1C1 = "=RC[-24]"
Range("AE10").Select
ActiveCell.FormulaR1C1 = "=RC[-21]"
Range("AF10").Select
ActiveCell.FormulaR1C1 = "=R[1]C[-22]"
Range("AG10").Select
ActiveCell.FormulaR1C1 = "=R[2]C[-23]"
Range("AH10").Select
ActiveCell.FormulaR1C1 = "=R[3]C[-24]"
Range("AB10:AH10").Select
Selection.Copy

For i = 1 To 10
Range("AB" & ActiveCell.Row + 4).Select
ActiveSheet.Paste
Next i

Range("AB10").Select


HTH,
Paul

"pgarcia" wrote in message
...
I have simple macro but I'm not that good with VB code. This is what I
have:
ActiveCell.FormulaR1C1 = "=RC[-25]"
Range("AC10").Select
ActiveCell.FormulaR1C1 = "=RC[-25]"
Range("AD10").Select
ActiveCell.FormulaR1C1 = "=RC[-24]"
Range("AE10").Select
ActiveCell.FormulaR1C1 = "=RC[-21]"
Range("AF10").Select
ActiveCell.FormulaR1C1 = "=R[1]C[-22]"
Range("AG10").Select
ActiveCell.FormulaR1C1 = "=R[2]C[-23]"
Range("AH10").Select
ActiveCell.FormulaR1C1 = "=R[3]C[-24]"
Range("AB10:AH10").Select
Selection.Copy
Range("AB14").Select
ActiveSheet.Paste
Range("AB18").Select
ActiveSheet.Paste
Range("AB22").Select
ActiveSheet.Paste
Range("AB26").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("AB10").Select
End Sub

What I like to do is run a loop. From the start point, I move down 4 rows
and paste my function and then I go down 4 rows and paste.
Thanks




  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 304
Default I need a simple loop with a 4+ row added in.

I changed the following and it keeps running on and on. I have to
Ctrl+Pause/Break to stop it. But it does work. Thanks.

For i = 1 To 10
To
For i = 1 To 5833

"PCLIVE" wrote:

This will repeat your pasting loop 10 times. Adjust as needed.

ActiveCell.FormulaR1C1 = "=RC[-25]"
Range("AC10").Select
ActiveCell.FormulaR1C1 = "=RC[-25]"
Range("AD10").Select
ActiveCell.FormulaR1C1 = "=RC[-24]"
Range("AE10").Select
ActiveCell.FormulaR1C1 = "=RC[-21]"
Range("AF10").Select
ActiveCell.FormulaR1C1 = "=R[1]C[-22]"
Range("AG10").Select
ActiveCell.FormulaR1C1 = "=R[2]C[-23]"
Range("AH10").Select
ActiveCell.FormulaR1C1 = "=R[3]C[-24]"
Range("AB10:AH10").Select
Selection.Copy

For i = 1 To 10
Range("AB" & ActiveCell.Row + 4).Select
ActiveSheet.Paste
Next i

Range("AB10").Select


HTH,
Paul

"pgarcia" wrote in message
...
I have simple macro but I'm not that good with VB code. This is what I
have:
ActiveCell.FormulaR1C1 = "=RC[-25]"
Range("AC10").Select
ActiveCell.FormulaR1C1 = "=RC[-25]"
Range("AD10").Select
ActiveCell.FormulaR1C1 = "=RC[-24]"
Range("AE10").Select
ActiveCell.FormulaR1C1 = "=RC[-21]"
Range("AF10").Select
ActiveCell.FormulaR1C1 = "=R[1]C[-22]"
Range("AG10").Select
ActiveCell.FormulaR1C1 = "=R[2]C[-23]"
Range("AH10").Select
ActiveCell.FormulaR1C1 = "=R[3]C[-24]"
Range("AB10:AH10").Select
Selection.Copy
Range("AB14").Select
ActiveSheet.Paste
Range("AB18").Select
ActiveSheet.Paste
Range("AB22").Select
ActiveSheet.Paste
Range("AB26").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("AB10").Select
End Sub

What I like to do is run a loop. From the start point, I move down 4 rows
and paste my function and then I go down 4 rows and paste.
Thanks





  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,311
Default I need a simple loop with a 4+ row added in.

By changing that number to 5833, the pasting process will loop 5,833 times.
This will put you at about row 23,342. I probably just appears to run on
and on.


"pgarcia" wrote in message
...
I changed the following and it keeps running on and on. I have to
Ctrl+Pause/Break to stop it. But it does work. Thanks.

For i = 1 To 10
To
For i = 1 To 5833

"PCLIVE" wrote:

This will repeat your pasting loop 10 times. Adjust as needed.

ActiveCell.FormulaR1C1 = "=RC[-25]"
Range("AC10").Select
ActiveCell.FormulaR1C1 = "=RC[-25]"
Range("AD10").Select
ActiveCell.FormulaR1C1 = "=RC[-24]"
Range("AE10").Select
ActiveCell.FormulaR1C1 = "=RC[-21]"
Range("AF10").Select
ActiveCell.FormulaR1C1 = "=R[1]C[-22]"
Range("AG10").Select
ActiveCell.FormulaR1C1 = "=R[2]C[-23]"
Range("AH10").Select
ActiveCell.FormulaR1C1 = "=R[3]C[-24]"
Range("AB10:AH10").Select
Selection.Copy

For i = 1 To 10
Range("AB" & ActiveCell.Row + 4).Select
ActiveSheet.Paste
Next i

Range("AB10").Select


HTH,
Paul

"pgarcia" wrote in message
...
I have simple macro but I'm not that good with VB code. This is what I
have:
ActiveCell.FormulaR1C1 = "=RC[-25]"
Range("AC10").Select
ActiveCell.FormulaR1C1 = "=RC[-25]"
Range("AD10").Select
ActiveCell.FormulaR1C1 = "=RC[-24]"
Range("AE10").Select
ActiveCell.FormulaR1C1 = "=RC[-21]"
Range("AF10").Select
ActiveCell.FormulaR1C1 = "=R[1]C[-22]"
Range("AG10").Select
ActiveCell.FormulaR1C1 = "=R[2]C[-23]"
Range("AH10").Select
ActiveCell.FormulaR1C1 = "=R[3]C[-24]"
Range("AB10:AH10").Select
Selection.Copy
Range("AB14").Select
ActiveSheet.Paste
Range("AB18").Select
ActiveSheet.Paste
Range("AB22").Select
ActiveSheet.Paste
Range("AB26").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("AB10").Select
End Sub

What I like to do is run a loop. From the start point, I move down 4
rows
and paste my function and then I go down 4 rows and paste.
Thanks







  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 304
Default I need a simple loop with a 4+ row added in.

Ya, I thought about that afterwards. I put it at around 1500 to take it down
to 6000 rows and that cover it.

I realy need to take a class. Thanks


"PCLIVE" wrote:

By changing that number to 5833, the pasting process will loop 5,833 times.
This will put you at about row 23,342. I probably just appears to run on
and on.


"pgarcia" wrote in message
...
I changed the following and it keeps running on and on. I have to
Ctrl+Pause/Break to stop it. But it does work. Thanks.

For i = 1 To 10
To
For i = 1 To 5833

"PCLIVE" wrote:

This will repeat your pasting loop 10 times. Adjust as needed.

ActiveCell.FormulaR1C1 = "=RC[-25]"
Range("AC10").Select
ActiveCell.FormulaR1C1 = "=RC[-25]"
Range("AD10").Select
ActiveCell.FormulaR1C1 = "=RC[-24]"
Range("AE10").Select
ActiveCell.FormulaR1C1 = "=RC[-21]"
Range("AF10").Select
ActiveCell.FormulaR1C1 = "=R[1]C[-22]"
Range("AG10").Select
ActiveCell.FormulaR1C1 = "=R[2]C[-23]"
Range("AH10").Select
ActiveCell.FormulaR1C1 = "=R[3]C[-24]"
Range("AB10:AH10").Select
Selection.Copy

For i = 1 To 10
Range("AB" & ActiveCell.Row + 4).Select
ActiveSheet.Paste
Next i

Range("AB10").Select


HTH,
Paul

"pgarcia" wrote in message
...
I have simple macro but I'm not that good with VB code. This is what I
have:
ActiveCell.FormulaR1C1 = "=RC[-25]"
Range("AC10").Select
ActiveCell.FormulaR1C1 = "=RC[-25]"
Range("AD10").Select
ActiveCell.FormulaR1C1 = "=RC[-24]"
Range("AE10").Select
ActiveCell.FormulaR1C1 = "=RC[-21]"
Range("AF10").Select
ActiveCell.FormulaR1C1 = "=R[1]C[-22]"
Range("AG10").Select
ActiveCell.FormulaR1C1 = "=R[2]C[-23]"
Range("AH10").Select
ActiveCell.FormulaR1C1 = "=R[3]C[-24]"
Range("AB10:AH10").Select
Selection.Copy
Range("AB14").Select
ActiveSheet.Paste
Range("AB18").Select
ActiveSheet.Paste
Range("AB22").Select
ActiveSheet.Paste
Range("AB26").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("AB10").Select
End Sub

What I like to do is run a loop. From the start point, I move down 4
rows
and paste my function and then I go down 4 rows and paste.
Thanks










  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 304
Default I need a simple loop with a 4+ row added in.

I have another problem. Can you help?

"PCLIVE" wrote:

By changing that number to 5833, the pasting process will loop 5,833 times.
This will put you at about row 23,342. I probably just appears to run on
and on.


"pgarcia" wrote in message
...
I changed the following and it keeps running on and on. I have to
Ctrl+Pause/Break to stop it. But it does work. Thanks.

For i = 1 To 10
To
For i = 1 To 5833

"PCLIVE" wrote:

This will repeat your pasting loop 10 times. Adjust as needed.

ActiveCell.FormulaR1C1 = "=RC[-25]"
Range("AC10").Select
ActiveCell.FormulaR1C1 = "=RC[-25]"
Range("AD10").Select
ActiveCell.FormulaR1C1 = "=RC[-24]"
Range("AE10").Select
ActiveCell.FormulaR1C1 = "=RC[-21]"
Range("AF10").Select
ActiveCell.FormulaR1C1 = "=R[1]C[-22]"
Range("AG10").Select
ActiveCell.FormulaR1C1 = "=R[2]C[-23]"
Range("AH10").Select
ActiveCell.FormulaR1C1 = "=R[3]C[-24]"
Range("AB10:AH10").Select
Selection.Copy

For i = 1 To 10
Range("AB" & ActiveCell.Row + 4).Select
ActiveSheet.Paste
Next i

Range("AB10").Select


HTH,
Paul

"pgarcia" wrote in message
...
I have simple macro but I'm not that good with VB code. This is what I
have:
ActiveCell.FormulaR1C1 = "=RC[-25]"
Range("AC10").Select
ActiveCell.FormulaR1C1 = "=RC[-25]"
Range("AD10").Select
ActiveCell.FormulaR1C1 = "=RC[-24]"
Range("AE10").Select
ActiveCell.FormulaR1C1 = "=RC[-21]"
Range("AF10").Select
ActiveCell.FormulaR1C1 = "=R[1]C[-22]"
Range("AG10").Select
ActiveCell.FormulaR1C1 = "=R[2]C[-23]"
Range("AH10").Select
ActiveCell.FormulaR1C1 = "=R[3]C[-24]"
Range("AB10:AH10").Select
Selection.Copy
Range("AB14").Select
ActiveSheet.Paste
Range("AB18").Select
ActiveSheet.Paste
Range("AB22").Select
ActiveSheet.Paste
Range("AB26").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("AB10").Select
End Sub

What I like to do is run a loop. From the start point, I move down 4
rows
and paste my function and then I go down 4 rows and paste.
Thanks








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
getting out of a if loop rk0909 Excel Discussion (Misc queries) 3 April 11th 06 03:55 PM
Do Loop BobBarker Excel Worksheet Functions 0 August 19th 05 08:44 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
Make it more simple or intuitive to do simple things Vernie Charts and Charting in Excel 1 March 16th 05 04:01 AM
Help With Loop Dennis Excel Worksheet Functions 2 February 1st 05 08:04 AM


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