Forum

Notifications
Clear all

Copy Paste

3 Posts
2 Users
0 Reactions
77 Views
(@bandikukargmail-com)
Posts: 23
Eminent Member
Topic starter
 
Good morning and happy new year everyone ^ _ ^ 
Admin, I have a trouble to copy and paste cells and removing empty columns based on the existing column
please help me create the correct copy and paste code based on this sample file ... thanks for taking the time to respond to my request
 
 
Posted : 29/12/2020 11:40 pm
(@purfleet)
Posts: 412
Reputable Member
 

There is no code in the attached workbook to review?

This is limited, but should start you off, the easist way to remove blank rows is to sort the data after pasting

Sub CopyPaste()

Worksheets("Sheet1").Range("c4:d24").Copy Worksheets("Paste").Range("c5")

Worksheets("Paste").Range("c4:d24").Sort key1:=Range("c4"), order1:=xlAscending, Header:=xlYes

End Sub

Also get rid of the merged cells in row 3, they will only cause you pain

 
Posted : 30/12/2020 2:22 am
(@bandikukargmail-com)
Posts: 23
Eminent Member
Topic starter
 
very helpful ,,, 
don't ever get bored of teaching me ,,, I will ask a lot more questions next week ,,,

thanks Purfleet ^_^
 
Posted : 31/12/2020 1:17 am
Share: