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

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
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:

Column AColumn BColumn CColumn DColumn E
AbCDEEGGHH
JJkKLLKJAs
WSEddDffgswqesZxc
x11

2

45

<tbody>
</tbody>










This is an Excel sheet before code:

When we press the button this will happen automatically:



Column AColumn BColumn CColumn DColumn EColumn BColumn CColumn A
AbCDEEGGHHCDEEAb
JJkKLLKJAsKKLLKJ
WSEddDffgswqesZxcEddDffgswge
x11

2

4511x

<tbody>
</tbody>












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,215,757
Messages
6,126,693
Members
449,331
Latest member
smckenzie2016

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