Hi All
Trying to copy specific column to another sheet but some columns need not to be copied but still being copied by the macro.
Should start at A1 of the new sheet
See attached of expected results
Can anyone help
Sub M1()
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Dim arr() As Variant
Dim var As Variant
Dim x As Long
Set ws1 = Sheets("corps")
Set ws2 = Sheets("csv")
With ws1
For Each var In Array("A", "B", "C", "D", "H", "I", "K", "L", " M", "Q", "R", "S", "T", "W")
x = .Range(CStr(var) & .Rows.Count).End(xlUp).Row
arr = .Range(CStr(var) & 1).Resize(x).Value
ws2.Range(CStr(var) & 1).Resize(UBound(arr, 1)).Value = arr
Erase arr
Next var
End With
Set ws1 = Nothing
Set ws2 = Nothing
End Sub
Bookmarks