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
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