Announcement

Collapse
No announcement yet.

Copy Data by Column to another Sheet

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Copy Data by Column to another Sheet

    Hi everyone,

    I am trying to copy data from one sheet to another sheet one column at a time. The reason is to get the data in a diff order by columns. In this sample I am copying column "A" in sheet Data1 to column "L" in sheet Data.

    I am using the following code without any success.

    Any help would be much appreciated:

    Code:
    Sub ComplileData()
    '
        Sheets("Data1").Select
        Range("A3").Select
        ActiveSheet.[a65536].End(xlUp)(1).Select
        Selection.Copy
        Sheets("Data").Select
        ActiveSheet.[L65536].End(xlUp)(2).Select
        Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
            False, Transpose:=False
    End Sub
    I am trying to grab the data from row 3 to the last row with data in it. Maybe there is a better way to rearrange data in columns, I am not sure of any other way other than to copy them one column at a time.

    Thanks for any help.
    Excelpower

  • #2
    Re: Copy Data by Column to another Sheet

    Your 3rd line is undoing the previous select. However you don't need the selects. Try the following:
    Sub ComplileData()
    With Sheets("Data1")
    .Range(.Range("A3"), .Range("A65536").End(xlUp)).Copy
    End With
    Sheets("Data").[L65536].End(xlUp)(2).PasteSpecial Paste:=xlValues
    End Sub
    Please do not U2U (private message) me directly for questions that should be posted to the forum; any such U2Us will be ignored.

    Comment


    • #3
      Re: Copy Data by Column to another Sheet

      Thank you very much Derk,

      Works like a charm. I like using your method much better without the selects.

      Excelpower

      Comment

      Working...
      X