Can I ask 2 quick questions.
I selected a range of columns and copied. When they paste into the new sheet however they don't paste in the order they were selected they paste in order of occurrence. here is my code. How can i paste as selected.
Second I defined a range of columns I wanted to apply autofit to but it errors. Is there a correct way to do this? this is what I did.
I selected a range of columns and copied. When they paste into the new sheet however they don't paste in the order they were selected they paste in order of occurrence. here is my code. How can i paste as selected.
Code:
Dim WS As Worksheet
Set WS = Sheets.Add
WS.Name = ("Report")
ActiveCell.FormulaR1C1 = "=Table_owssvr_1[Column1]"
Range("A1").Select
Selection.ClearContents
Sheets("Data").Select
Range("O:O,P:P,S:S,R:R,E:E,F:F,G:G").Select
Selection.Copy
Sheets("Report").Select
Range("A1").Select
ActiveSheet.Paste
Second I defined a range of columns I wanted to apply autofit to but it errors. Is there a correct way to do this? this is what I did.
Code:
Columns("O:O,P:P,S:S,R:R,E:E,F:F,G:G").EntireColumn.AutoFit