PDA

View Full Version : How to loop copy & paste



btiongsonjr
04-26-2016, 03:31 AM
Hi,

I am a newbie in macro. I tried recording a macro doing copy and paste. There are around 5847 values from Sheet1 to be copied to Sheet2. The recorded macro looks like this:

Sheets("Sheet1").Select
Range("A2").Select
Selection.Copy
Sheets("Sheet2").Select
Range("A2:A228").Select
Selection.PasteSpecial paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Sheets("Sheet1").Select
Range("B1:HT1").Select
Selection.Copy
Sheets("Sheet2").Select
Range("B2:B228").Select
Selection.PasteSpecial paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True

I want to repeat the process but recording it will be too tedious. I hope I can loop the process but I don't know how. Can anybody help me please? I have attached the file.