H
Howard
This will get the job done, but seems really clunky to me.
Where I have a number of columns on sheet 1, some are longer than others, and want to copy them to sheet 2 with a blank column between each copied column.
So I could just continue to duplicate the lines column A to A and then column B to C and then column C to E and so on, but there has to be a cleaner way.
Also, the number of columns on the first sheet (copy from) could vary so I would need to use something like this to determine the number of columns.
i = Cells(1).End(xlToRight).Column
Thanks,
Howard
Option Explicit
Sub CopyCol()
Range("A1:A" & Range("A1").End(xlDown).Row).Copy
Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp)(2).PasteSpecial Paste:=xlPasteValues
Range("B1:B" & Range("B1").End(xlDown).Row).Copy
Sheets("Sheet2").Range("C" & Rows.Count).End(xlUp)(2).PasteSpecial Paste:=xlPasteValues
Range("C1:C" & Range("C1").End(xlDown).Row).Copy
Sheets("Sheet2").Range("E" & Rows.Count).End(xlUp)(2).PasteSpecial Paste:=xlPasteValues
End Sub
Where I have a number of columns on sheet 1, some are longer than others, and want to copy them to sheet 2 with a blank column between each copied column.
So I could just continue to duplicate the lines column A to A and then column B to C and then column C to E and so on, but there has to be a cleaner way.
Also, the number of columns on the first sheet (copy from) could vary so I would need to use something like this to determine the number of columns.
i = Cells(1).End(xlToRight).Column
Thanks,
Howard
Option Explicit
Sub CopyCol()
Range("A1:A" & Range("A1").End(xlDown).Row).Copy
Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp)(2).PasteSpecial Paste:=xlPasteValues
Range("B1:B" & Range("B1").End(xlDown).Row).Copy
Sheets("Sheet2").Range("C" & Rows.Count).End(xlUp)(2).PasteSpecial Paste:=xlPasteValues
Range("C1:C" & Range("C1").End(xlDown).Row).Copy
Sheets("Sheet2").Range("E" & Rows.Count).End(xlUp)(2).PasteSpecial Paste:=xlPasteValues
End Sub