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
 

Some videos you may like

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Watch MrExcel Video

Forum statistics

Threads
1,123,125
Messages
5,599,856
Members
414,342
Latest member
K Darrell Smith

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
Top