+ Reply to Thread
Results 1 to 3 of 3

copy data from one column to column on another sheet starting with first open cell

Hybrid View

  1. #1
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,651

    Re: copy data from one column to column on another sheet starting with first open cell

    This will loop through all the worksheets if that's what you want.

    AdvancedFilter assumes the top cell (B1 in the case) in the filter range to be a header.

    Sub PopulatePlayers()
        Dim ws As Worksheet
        For Each ws In Worksheets
            If ws.Name <> "Overall Leaderboard" Then
                If Not IsEmpty(ws.Range("B1")) Then
                    With ws.Range("B1", ws.Range("B" & Rows.Count).End(xlUp))
                        .AdvancedFilter Action:=xlFilterInPlace, Unique:=True
                        .Offset(1).Copy Sheets("Overall Leaderboard").Range("B" & Rows.Count).End(xlUp).Offset(1)
                        If ws.FilterMode Then ws.ShowAllData
                    End With
                End If
            End If
        Next ws
    End Sub
    This copies from just the activehseet.

    Sub PopulatePlayers()
        With Range("B1", Range("B" & Rows.Count).End(xlUp))
            .AdvancedFilter Action:=xlFilterInPlace, Unique:=True
            .Offset(1).Copy Sheets("Overall Leaderboard").Range("B" & Rows.Count).End(xlUp).Offset(1)
            If ActiveSheet.FilterMode Then ActiveSheet.ShowAllData
        End With
        MsgBox "Unique Players copied", vbInformation, "Copy Complete"
    End Sub
    Last edited by AlphaFrog; 08-26-2013 at 01:47 PM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro to search for text then copy data from that row starting in different column
    By balston2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-09-2013, 10:43 AM
  2. Copy column data on one sheet to row or column date on another sheet based on user in
    By soready42012 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-08-2012, 12:03 AM
  3. create multiple column rows starting from data in one column
    By thotosch in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-03-2012, 01:20 AM
  4. Replies: 0
    Last Post: 05-24-2010, 05:17 PM
  5. Copy Data from Column and Paste to Next Blank Column on 2nd Sheet
    By adammark in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-19-2010, 11:15 AM

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1