Results 1 to 3 of 3

Thread: Copy Table Range Till Last Row Using VBA

  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    9
    Rep Power
    0

    Copy Table Range Till Last Row Using VBA

    Hi,

    Good day! I would like to loop on my table that will transfer the row data to sheet2 up to the last end value.

    br,

    ivan
    Attached Files Attached Files

  2. #2
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    Code:
    Sub MoveTableEntire()
    
        With Worksheets("Sheet1")
            .Range("A1:F1").Copy Worksheets("Sheet2").Range("A1")
            .Range("A2:F" & Application.Max(2, .Cells(.Rows.Count, 1).End(xlUp).Row)).Copy Worksheets("Sheet2").Range("A" & Rows.Count).End(xlUp)(2)
        End With
        
    End Sub
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  3. #3
    Junior Member
    Join Date
    Apr 2013
    Posts
    9
    Rep Power
    0
    Thanks Excel Fox,
    But what i need is the output should be like in Col I to Col O, sorry i wasn't able to explain it well.

    The logic is to check the first row with value in col B and lookup the next value in col C up to the last value which Col C is not available in Col B.

    br,

Similar Threads

  1. Copy/Paste Excel Range/Chart into Powerpoint VBA
    By Admin in forum Excel and VBA Tips and Tricks
    Replies: 1
    Last Post: 03-13-2014, 02:59 PM
  2. Replies: 3
    Last Post: 05-14-2013, 03:25 PM
  3. Replace Pivot Table Source Range with New Address VBA
    By Admin in forum Excel and VBA Tips and Tricks
    Replies: 1
    Last Post: 04-25-2013, 07:51 PM
  4. Replies: 5
    Last Post: 11-28-2012, 06:37 PM
  5. Trapping Copy To Range Before Copy/Cut Paste
    By Rasm in forum Excel Help
    Replies: 4
    Last Post: 04-07-2011, 07:48 PM

Posting Permissions

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