![]() |
|
#1
|
|||
|
|||
|
Could you please help me write a loop code for this sequence?
I copy the table Y1:AT4 (containing information from the table A2:X8 I insert the information of consecutive rows: Range("A4:V4").Select Range("A5:V5").Select Range("A6:V6").Select Until the first empty row. And I copy a value and paste it in the new table, Thank you here is the code: Code:
Range("Y1:AT4").Select
Selection.Copy
Range("Y6").Select
ActiveSheet.Paste
Range("A4:V4").Select
Application.CutCopyMode = False
Selection.Copy
Range("Y8").Select
ActiveSheet.Paste
Range("AT9").Select
Application.CutCopyMode = False
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=R[-5]C[-22]"
Range("Y1:AT4").Select
Selection.Copy
Range("Y11").Select
ActiveSheet.Paste
Range("A5:V5").Select
Application.CutCopyMode = False
Selection.Copy
Range("Y13").Select
ActiveSheet.Paste
Range("AT14").Select
Application.CutCopyMode = False
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=R[-9]C[-22]"
Range("Y1:AT4").Select
Selection.Copy
ActiveWindow.SmallScroll Down:=2
Range("Y16").Select
ActiveSheet.Paste
Range("A6:V6").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.SmallScroll Down:=3
Range("Y18").Select
ActiveSheet.Paste
Range("AT19").Select
Application.CutCopyMode = False
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=R[-13]C[-22]"
Range("AT20").Select
ActiveWindow.SmallScroll Down:=-12
Last edited by macropod; 03-25-2017 at 12:27 AM. Reason: Added code tags |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Creating VBA Code to Delete Empty Column in Table | Faugs | Word VBA | 5 | 08-07-2014 03:29 PM |
| How do you loop through an array with some empty values? | omahadivision | Excel Programming | 5 | 11-28-2013 10:49 AM |
How to a For loop in VBA
|
Jennifer Murphy | Word VBA | 1 | 01-29-2013 03:30 AM |
| Apparently empty (blank) cells aren't empty | daymaker | Excel | 3 | 03-08-2012 03:41 PM |
Continuous Loop
|
cksm4 | Word | 6 | 01-06-2011 09:03 PM |