Need help with excel vba

%3CLINGO-SUB%20id%3D%22lingo-sub-1520157%22%20slang%3D%22en-US%22%3ENeed%20help%20with%20excel%20vba%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1520157%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F307537%22%20target%3D%22_blank%22%3E%40xspJody%3C%2FA%3E%20I%20have%20two%20worksheets%201-%20copy%202-%20dest%3CBR%20%2F%3EFirstly%2C%20I%20have%20to%20delete%201%20and%205%20column%20and%20then%20copy%20data%20from%202nd%20column%20to%204%20th%20column%20and%20paste%20in%20dest%20sheet%20next%20to%20available%20column%20(means%20next%20to%20last%20column%20used).%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1520157%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%20VBA%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%20VBA%20messaging%20to%20teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1520734%22%20slang%3D%22en-US%22%3ERe%3A%20Need%20help%20with%20excel%20vba%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1520734%22%20slang%3D%22en-US%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F600385%22%20target%3D%22_blank%22%3E%40Suma_shankar%3C%2FA%3E%3C%2FP%3E%3CP%3EMaybe%20you%20have%20more%20chances%20to%20get%20your%20answer%20in%20the%20Excel%20community%20here%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fexcel%2Fct-p%2FExcel_Cat%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fexcel%2Fct-p%2FExcel_Cat%3C%2FA%3E%3C%2FP%3E%3CP%3EGood%20luck%3C%2FP%3E%3CP%3ECheers%3CBR%20%2F%3ERolf%3CBR%20%2F%3E%3CBR%20%2F%3E%23MCT%20%23LearnWithRolf%20%23TheCloud42%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1536341%22%20slang%3D%22en-US%22%3ERe%3A%20Need%20help%20with%20excel%20vba%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1536341%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F600385%22%20target%3D%22_blank%22%3E%40Suma_shankar%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you're%20still%20looking%20for%20a%20solution%20you%20could%20try%20this%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-vbnet%22%3E%3CCODE%3ESub%20MySub()%0A%20%20%20%20ActiveCell.Columns(%22A%3AE%22).EntireColumn.Select%0A%20%20%20%20Selection.Copy%0A%20%20%20%20Windows(%22Book2%22).Activate%0A%20%20%20%20ActiveCell.Range(%22A1%22).Select%0A%20%20%20%20Selection.End(xlToRight).Select%0A%20%20%20%20ActiveCell.Offset(0%2C%201).Columns(%22A%3AA%22).EntireColumn.Select%0A%20%20%20%20Selection.Insert%20Shift%3A%3DxlToRight%0AEnd%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor
@xspJody I have two worksheets 1- copy 2- dest
Firstly, I have to delete 1 and 5 column and then copy data from 2nd column to 4 th column and paste in dest sheet next to available column (means next to last column used).
2 Replies
Highlighted

Hello @Suma_shankar

Maybe you have more chances to get your answer in the Excel community here:

https://techcommunity.microsoft.com/t5/excel/ct-p/Excel_Cat

Good luck

Cheers
Rolf
#MCT #LearnWithRolf #TheCloud42 

Highlighted

@Suma_shankar 

 

If you're still looking for a solution you could try this

Sub MySub()
    ActiveCell.Columns("A:E").EntireColumn.Select
    Selection.Copy
    Windows("Book2").Activate
    ActiveCell.Range("A1").Select
    Selection.End(xlToRight).Select
    ActiveCell.Offset(0, 1).Columns("A:A").EntireColumn.Select
    Selection.Insert Shift:=xlToRight
End Sub