Loading
Ozgrid Excel Help & Best Practices Forums

Excel Video Tutorials / Excel Dashboards Reports



Results 1 to 3 of 3

Thread: Copy Data by Column to another Sheet

  1. #1
    Join Date
    12th March 2003
    Location
    Galvez, La.
    Posts
    222

    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:

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

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    15th April 2003
    Location
    USA
    Posts
    7,422

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

    Excel Video Tutorials / Excel Dashboards Reports


  3. #3
    Join Date
    12th March 2003
    Location
    Galvez, La.
    Posts
    222

    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

    Excel Video Tutorials / Excel Dashboards Reports


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Possible Answers

  1. Replies: 8
    Last Post: March 25th, 2009, 10:48
  2. Replies: 8
    Last Post: March 7th, 2008, 07:22
  3. Replies: 2
    Last Post: September 17th, 2007, 20:09
  4. Replies: 2
    Last Post: March 7th, 2007, 17:12
  5. Replies: 5
    Last Post: June 3rd, 2005, 14:39

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
porno