1

Newbie here and would like to get a loop working in Microsoft excel. Basically, to arrange clusters / ranges from horizontal to vertical. I have tried transpose function but have not been successful to get a code working and it seems most samples are arranging cells. hopefully someone can enlighten me with this. thanks (B2:C4), (D2:E4), (F2:G4) to be re-arrange (B2:C4), (B5:C7), (B8:C10)

enter image description here

9
  • 3
    what do you mean by "arrange"? move the cells? copy contents? what have you tried? Commented Apr 18 at 9:48
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Apr 18 at 13:02
  • I would like to have a loop to have the ranges from top to bottom.
    – DongM
    Commented Apr 18 at 13:12
  • 1
    @DongM "have" is not an action, please be specific what you'd like to do with those ranges. Also posting code you've tried would help a lot. Commented Apr 18 at 13:25
  • 2
    please edit your question instead of adding multiple lines of code in a comment Commented Apr 18 at 16:29

1 Answer 1

2

you can use something like this:

Sub move_cells()
    With ActiveSheet
        .Range("d2:e4").Cut .Range("b5")
        .Range("f2:g5").Cut .Range("b8")
    End With
End Sub

Not the answer you're looking for? Browse other questions tagged .