Copy many columns and past it in one single column

Closed
dobdobdob Posts 2 Registration date Sunday January 6, 2013 Status Member Last seen January 6, 2013 - Jan 6, 2013 at 01:02 AM
Zohaib R Posts 2368 Registration date Sunday September 23, 2012 Status Member Last seen December 13, 2018 - Jan 6, 2013 at 03:43 AM
Hello, I am trying to copy many columns C,D, and G and paste them into on column B in the first blank cell in the same sheet and I will need to do the same procedure but copy from one sheet to another ?I am very new with this and I have no idea which code should be written I would like you to help in that. I have tried to record a macro for copy many columns and I did that but I could not write a code to paste them automatically in column B in the first blank cell...
Please help me.

3 responses

Zohaib R Posts 2368 Registration date Sunday September 23, 2012 Status Member Last seen December 13, 2018 69
Jan 6, 2013 at 01:49 AM
Hi dobdobdob,

Instead of using `Copy' and `Paste' use the below mentioned formula in `B1' and drag using the Microsoft Excel Fill Handle till the last row:

=C1 & " " & D1 & " " & G1

Do reply with results.
1
dobdobdob Posts 2 Registration date Sunday January 6, 2013 Status Member Last seen January 6, 2013
Jan 6, 2013 at 02:08 AM
Hi zohaib R
I am using this code

Sub copy2()
'
' copy2 Macro
'
' Keyboard Shortcut: Option+Cmd+j
'

Range("C163:C183").Select
Selection.copy
Range("B183").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, transpose:=False
lMaxRows = Cells(Rows.Count, "B").End(xlUp).Row
Range("B" & lMaxRows + 1).Select

End Sub


What I want is to use the same code for next column now this macro works for column c only when I tried to run it for next column e.g. column D it is not work. I need to multiply the action for many columns here am facing problem?



Many Thanks
0
Zohaib R Posts 2368 Registration date Sunday September 23, 2012 Status Member Last seen December 13, 2018 69
Jan 6, 2013 at 03:43 AM
Hi dobdobdob,

Your code is good; add the following lines to your code to duplicate the action for Column D:

Range("D183").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
lMaxRows = Cells(Rows.Count, "D").End(xlUp).Row
Range("D" & lMaxRows + 1).Select

Please revert for clarification.
0