I am trying to write a macro to copy each line from columns A to E and paste each row 3 times on another tab. I need this macro to loop through until it hits a blank row. Here is code that I recorded, but I do not know how to make this into a loop. I also have a piece of code that grabs F to I and then transposes this piece when pasted to the UIL tab.
Lastly, it would be great if I could build in this code to copy the range g2:G5 and paste this in the UIL tab until I hit a blank row based on column A.
Code:
Sub MakeDuplicatesofEachRow()
Sheets("Data").Select
Range("A2:E2").Select
Selection.Copy
Sheets("UIL").Select
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Data").Select
Range("F2:I2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("UIL").Select
Range("F2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
End Sub
Lastly, it would be great if I could build in this code to copy the range g2:G5 and paste this in the UIL tab until I hit a blank row based on column A.
Code:
Sub Macro5()
Sheets("UIL").Select
Range("G2:G5").Select
Application.CutCopyMode = False
Selection.Copy
Range("G6").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub