copy all the data excluding column 'D'

GirishDhruva

Active Member
Joined
Mar 26, 2019
Messages
308
Hi Everyone,

i am trying to copy all the data from one sheet to another in same workbook.

In master sheet i have A:AW columns of data were i should copy all the data excluding 'D' column, and paste that copied data in another sheet

Can anyone help me how to solve this


Thanks in advance
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
So is column A going to column A, column B going to column B etc? Also do you want to leave column D blank at destination?
 
Upvote 0
Yes...... Column A going to column A, column B going to column B etc but from source column D should be neglected/shouldn't be copied but in destination in the place of column D from source column E's value should be pasted
 
Upvote 0
Use

Code:
Sub MM1()
 Dim lr As Long
lr = Cells.Find("*", , xlValues, , xlRows, xlPrevious).Row
Range("A1:C" & lr).Copy Sheets("Sheet2").Range("A1")
Range("E1:AW" & lr).Copy Sheets("Sheet2").Range("D1")
End Sub
 
Upvote 0
Code:
Sub MM1()
Dim lr As Long, lr2 As Long
lr = Cells.Find("*", , xlValues, , xlRows, xlPrevious).Row
lr2 = Sheets("Sheet2").Cells.Find("*", , xlValues, , xlRows, xlPrevious).Row
Range("A1:C" & lr).Copy Sheets("Sheet2").Range("A" & lr2)
Range("E1:AW" & lr).Copy Sheets("Sheet2").Range("D" & lr2)
End Sub
 
Upvote 0
Shorter....

Code:
Sub MM1()
Dim lr As Long, lr2 As Long
lr = Cells.Find("*", , xlValues, , xlRows, xlPrevious).Row
lr2 = Sheets("Sheet2").Cells.Find("*", , xlValues, , xlRows, xlPrevious).Row
Range("A1:C" & lr, "E1:AW" & lr).Copy Sheets("Sheet2").Range("A" & lr2)
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,185
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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