Macro not copying correct data [Closed]

Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
hi m trying to copy column D from one tab and pasting it in another tab. When i luk into code it shows copying (D:D) but it selects columns A-D and pastes all the four columns in the another tab... Can you help me in this?

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
767
Columns("D").select
Selection.copy
Sheets("Sheet2").select
Cells(1, "A").select
activesheet.paste
Thank you for your help....but this code is also working fine for other columns but when I type for column D its taking data from A- D...
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
767
Because you must have a merged cell A-D in between
I have not merged any data myself . have just copied data from somewhr nd pasted in excel. Is there any solution for this?.how can i proceed further?
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
767
One thing that you can try is highlight the columns, right click and choose format and then go to alignment tab. At the bottom you would see merge option. If in the selected column there is a merge cells you would notice that the box is highlighted. Click it twice to remove the check box and click ok. That will remove any merge cells

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!