Try this code
Option Explicit
Sub copy_paste()
Dim i As Long, lrow As Long, lcol As Long
Application.ScreenUpdating = False
With Worksheets("Sheet2")
lcol = .Range("IV1").End(xlToLeft).Column
lrow = .Range("A" & .Rows.Count).End(xlUp).Row
For i = 2 To lcol Step 2
.Range(.Cells(2, i), .Cells(lrow, i)).Copy
.Cells(2, i).PasteSpecial (xlPasteValues)
Next i
End With
Application.ScreenUpdating = True
End Sub
Copy the Excel VBA code
Select the workbook in which you want to store the Excel VBA code
Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
Choose Insert | Module
Where the cursor is flashing, choose Edit | Paste
To run the Excel VBA code:
Choose View | Macros
Select a macro in the list, and click the Run button
Bookmarks