Avatar of 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.

John Smith            data
Paul Rucks                      data
Steve Parker      data

How do I get a list of only the names?

Sub CopyTraders()

    Dim Trader As Range
    Dim Traders As Range
    Dim ColCount As Integer
    Set Traders = Range(ActiveCell, ActiveCell.End(xlDown))
    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

8/22/2022 - Mon