Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy Multiple Columns, Paste Under a Single column | Excel Worksheet Functions | |||
Copy and Paste Formula from ActiveCell to cells in 13 columns priorto the active column | Excel Programming | |||
Need macro to check if cell is not blank & previous cell is blank, copy information from row above & paste | Excel Programming | |||
Cut & Paste into column only if column cell is blank. | Excel Programming | |||
Macro copy and paste = blank worksheet | Excel Discussion (Misc queries) |