Copying and Pasting

abdullahsikandar

Board Regular
Joined
Feb 10, 2014
Messages
52
Hi Guys,

I need a small help from you guys, I need to copy Paste Column A,B,C and D column into the end of the sheet with their headings.

Can anyone help me out in that case?

Thanks in Advance
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
You should definitely provide more information, because I don't understand what you want to achieve.
 
Upvote 0
Well i have an excel sheet which have 20 columns and what i need is to copy column 4,5,6 and 7 in the last by using macro.

I have a button so what i need is whenever i click that button it will automatically copy and paste column 4,5,6 and 7 in the end of the columns.

Did you get it now? Sorry for the misconception..
 
Upvote 0
Still rather unclear. Something like?

Code:
Range("D1", Cells(Rows.Count, "G").End(xlUp)).Copy Cells(1, Columns.Count).End(xlToLeft).Offset(1)
 
Upvote 0
Still rather unclear. Something like?

Code:
Range("D1", Cells(Rows.Count, "G").End(xlUp)).Copy Cells(1, Columns.Count).End(xlToLeft).Offset(1)


Example:

[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Column A[/TD]
[TD]Column B[/TD]
[TD]Column C[/TD]
[TD]Column D[/TD]
[TD]Column E[/TD]
[/TR]
[TR]
[TD]Ab[/TD]
[TD]CD[/TD]
[TD]EE[/TD]
[TD]GG[/TD]
[TD]HH[/TD]
[/TR]
[TR]
[TD]JJ[/TD]
[TD]kK[/TD]
[TD]LL[/TD]
[TD]KJ[/TD]
[TD]As[/TD]
[/TR]
[TR]
[TD]WS[/TD]
[TD]Edd[/TD]
[TD]Dffg[/TD]
[TD]swqe[/TD]
[TD]sZxc[/TD]
[/TR]
[TR]
[TD]x[/TD]
[TD]1[/TD]
[TD]1

[/TD]
[TD]2

[/TD]
[TD]45[/TD]
[/TR]
</tbody>[/TABLE]










This is an Excel sheet before code:

When we press the button this will happen automatically:



[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Column A[/TD]
[TD]Column B[/TD]
[TD]Column C[/TD]
[TD]Column D[/TD]
[TD]Column E[/TD]
[TD]Column B[/TD]
[TD]Column C[/TD]
[TD]Column A[/TD]
[/TR]
[TR]
[TD]Ab[/TD]
[TD]CD[/TD]
[TD]EE[/TD]
[TD]GG[/TD]
[TD]HH[/TD]
[TD]CD[/TD]
[TD]EE[/TD]
[TD]Ab[/TD]
[/TR]
[TR]
[TD]JJ[/TD]
[TD]kK[/TD]
[TD]LL[/TD]
[TD]KJ[/TD]
[TD]As[/TD]
[TD]KK[/TD]
[TD]LL[/TD]
[TD]KJ[/TD]
[/TR]
[TR]
[TD]WS[/TD]
[TD]Edd[/TD]
[TD]Dffg[/TD]
[TD]swqe[/TD]
[TD]sZxc[/TD]
[TD]Edd[/TD]
[TD]Dffg[/TD]
[TD]swge[/TD]
[/TR]
[TR]
[TD]x[/TD]
[TD]1[/TD]
[TD]1

[/TD]
[TD]2

[/TD]
[TD]45[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]x[/TD]
[/TR]
</tbody>[/TABLE]












This would be the result when i would press the button. I guess this will clear you.
 
Upvote 0
I don't understand the logic. I see that you are copying cells but I cannot see a clear pattern.
Or it must be pasting errors from your side.
 
Upvote 0
Or i can say like that I need to copy and paste the columns when the columns finished.

The code you sent me earlier that`s working but the headings are coming on the second row not in the first and I don`t need a group of column i need it separately so i can make it work easily like for Example i need column A, B and E.
 
Upvote 0
Code:
Range("B2", Cells(Rows.Count, "B").End(xlUp)).Copy Cells(2, Columns.Count).End(xlToLeft).Offset(1)
Range("C2", Cells(Rows.Count, "C").End(xlUp)).Copy Cells(2, Columns.Count).End(xlToLeft).Offset(1)
Range("A2", Cells(Rows.Count, "A").End(xlUp)).Copy Cells(2, Columns.Count).End(xlToLeft).Offset(1)

This should help you. Please experiment before posting, should it not be 100% what you need.
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,107
Members
452,302
Latest member
TaMere

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top