Share via

HOW TO USE FOR LOOP OR FOR EACH LOOP TO COPY ENTIRE A COLUMN AND PASTE IT TO ENITRE B,C,D,E.....Z COLUMN

Anonymous
2021-02-18T14:06:57+00:00
A B C D E F G Z
ALEX
JACOB
RYAN
DENY

HOW TO COPY ENTIRE A COLUMN AND PASTE IT'S TO B,C,D,E........Z USING FOREACH OR FOR LOOP

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
  1. Anonymous
    2021-02-19T09:20:26+00:00

    If you want to copy the values only,

    Then use this code

    Sub Copy_with_Loop()

    Dim x As Long

    Dim myRange As Range

    Set myRange = Range(Cells(1, "B"), Cells(Rows.Count, "B").End(xlUp))

    For x = 1 To 45 ''' Change the number of loops as per your needs

        myRange.Offset(0, x).Value = myRange.Value
    

    Next x

    End Sub

    I hope this finally meet your requirements and gives you the solution you are after

    Regards

    1 person found this answer helpful.
    0 comments No comments

24 additional answers

Sort by: Most helpful
  1. Anonymous
    2021-02-18T14:38:06+00:00

    but i need loop

    A B C D E F G Z
    ALEX ALEX ALEX ALEX
    JACOB JACOB JACOB JACOB
    RYAN RYAN RYAN RYAN
    DENY DENY DENY DENY

    LIKE THIS

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2021-02-18T14:52:16+00:00

    These codes work like this

    A B C D E F G Z
    ALEX ALEX JACOB RYAN DENY
    JACOB
    RYAN
    DENY

    AND I WANT

    A B C D E F G Z
    ALEX ALEX ALEX ALEX ALEX
    JACOB JACOB JACOB JACOB JACOB
    RYAN RYAN RYAN RYAN RYAN
    DENY DENY DENY DENY DENY

    PLEASE HELP

    0 comments No comments
  3. HansV 462.6K Reputation points MVP Volunteer Moderator
    2021-02-18T14:42:05+00:00

    Like this:

    Sub Test()
        Dim r As Long
        Dim m As Long
        m = Range("A" & Rows.Count).End(xlUp).Row
        For r = 1 To m
            Cells(1, r + 1).Value = Cells(r, 1).Value
        Next r
    End Sub

    0 comments No comments
  4. HansV 462.6K Reputation points MVP Volunteer Moderator
    2021-02-18T14:21:16+00:00

    There is no need to loop:

    Sub Test()
        Dim m As Long
        m = Range("A" & Rows.Count).End(xlUp).Row
        Range("B1").Resize(, m).Value = Application.Transpose(Range("A1").Resize(m).Value)
    End Sub

    0 comments No comments