I am teaching myself VBA and I have been running a certain task via Copy and PasteSpecial Paste:=xlPasteValues and it completes the macro within 7 seconds. The task is to move the values to the left by one column.
I've recently read the clipboard should be avoided when possible thus I used an alternative method which was suggested. However, I've found this method results in the macro taking 40 seconds to complete! Thus, please can someone tell me if there is another way that enables my macro to run as fast as the clipboard method, but without using the clipboard?
An extract of the alternative method is below, but please note this is just one section, there are about 200 lines of code required to transfer values.
If anyone can help I will really appreciate it and I will return to give thanks.
I've recently read the clipboard should be avoided when possible thus I used an alternative method which was suggested. However, I've found this method results in the macro taking 40 seconds to complete! Thus, please can someone tell me if there is another way that enables my macro to run as fast as the clipboard method, but without using the clipboard?
An extract of the alternative method is below, but please note this is just one section, there are about 200 lines of code required to transfer values.
If anyone can help I will really appreciate it and I will return to give thanks.
Code:
Sub Test()
'TRANSFER VALUES
'Team A
Worksheets("Sheet1").Range("U471:AE471").Value = Worksheets("Sheet1").Range("V471:AF471").Value
Worksheets("Sheet1").Range("U473:AE473").Value = Worksheets("Sheet1").Range("V473:AF473").Value
Worksheets("Sheet1").Range("U475:AE475").Value = Worksheets("Sheet1").Range("V475:AF475").Value
'Team B
Worksheets("Sheet1").Range("U477:AE477").Value = Worksheets("Sheet1").Range("V477:AF477").Value
Worksheets("Sheet1").Range("U479:AE479").Value = Worksheets("Sheet1").Range("V479:AF479").Value
Worksheets("Sheet1").Range("U481:AE481").Value = Worksheets("Sheet1").Range("V481:AF481").Value
'Team C
Worksheets("Sheet1").Range("U483:AE483").Value = Worksheets("Sheet1").Range("V483:AF483").Value
Worksheets("Sheet1").Range("U485:AE485").Value = Worksheets("Sheet1").Range("V485:AF485").Value
Worksheets("Sheet1").Range("U487:AE487").Value = Worksheets("Sheet1").Range("V487:AF487").Value
'Team D
Worksheets("Sheet1").Range("U489:AE489").Value = Worksheets("Sheet1").Range("V489:AF489").Value
Worksheets("Sheet1").Range("U491:AE491").Value = Worksheets("Sheet1").Range("V491:AF491").Value
Worksheets("Sheet1").Range("U493:AE493").Value = Worksheets("Sheet1").Range("V493:AF493").Value
'Team E
Worksheets("Sheet1").Range("U495:AE495").Value = Worksheets("Sheet1").Range("V495:AF495").Value
Worksheets("Sheet1").Range("U497:AE497").Value = Worksheets("Sheet1").Range("V497:AF497").Value
Worksheets("Sheet1").Range("U499:AE499").Value = Worksheets("Sheet1").Range("V499:AF499").Value
End Sub