Copy from Perticular Range from one sheet to another

PATTANAM

Board Regular
Joined
Sep 28, 2011
Messages
132
Hello All,

I need your assistance to reduce the coding lines.

I have one excel file, in this file I need to copy from one sheet (input Data) to another sheet (output data) but not entire data only specified columns.

Here is the below code I have written.. I would request, could you please helps to reduce the coding line items, since I have many more files to be created.

</SPAN>Sub Inputtooutput()
'
' Coding for Converting from Input data to Output data.

Sheets("Input Data").Select
Columns("W:W").Select
Selection.Copy
Sheets("Output Data").Select
Columns("R:R").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False


Sheets("Input Data").Select
Columns("W:W").Select
Selection.Copy
Sheets("Output Data").Select
Columns("AH:AH").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False

Sheets("Input Data").Select
Columns("X:X").Select
Selection.Copy
Sheets("Output Data").Select
Columns("AG:AG").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False

Sheets("Input Data").Select
Columns("Y:Y").Select
Selection.Copy
Sheets("Output Data").Select
Columns("AJ:AJ").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False

Sheets("Input Data").Select
Columns("AA:AA").Select
Selection.Copy
Sheets("Output Data").Select
Columns("AM:AM").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False

Sheets("Input Data").Select
Columns("AB:AB").Select
Selection.Copy
Sheets("Output Data").Select
Columns("AE:AE").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End Sub
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,215,650
Messages
6,126,019
Members
449,280
Latest member
Miahr

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