Avatar of efarhat
efarhat

asked on 

Easy: Copy names from one sheet to another. (EXCEL)

This is what I was looking for when I meant copy column data over.  I only wanted to copy the names into a another sheet but I want them to be in 4 columns instead of one long column?  4 cols of 15 person each. There is spacing problems too.

[code]
John Smith            data
                      data
Paul Rucks                      data
Steve Parker      data
                      data
            data
[/code]

How do I get a list of only the names?


Sub CopyTraders()

    Dim Trader As Range
    Dim Traders As Range
    Dim ColCount As Integer
   
    Sheets("Report").Select
    Range("A1").Select
   
    Set Traders = Range(ActiveCell, ActiveCell.End(xlDown))
   
    Sheets("Layout").Select
    Range("A1").Select
   
    ColCount = 1
    For Each Trader In Traders
        If ColCount > 3 Then  ' set this value to the number of columns you require
            ColCount = 1
            ActiveCell.Offset(1, 0).Select
        End If
        ActiveCell.Offset(0, (ColCount - 1) * 2).Value = Trader
        ColCount = ColCount + 1
    Next Trader
   
   
End Sub
Visual Basic Classic

Avatar of undefined
Last Comment
efarhat

8/22/2022 - Mon