Columns & Rows Help

[Solved/Closed]
Report
Posts
10
Registration date
Monday January 4, 2016
Status
Member
Last seen
February 19, 2016
-
Posts
10
Registration date
Monday January 4, 2016
Status
Member
Last seen
February 19, 2016
-
Hello all,

In short, here is what I need help doing:

I would like to take 15 items in one column and transfer them into a row in another spreadsheet. When the items are transferred, I would like for them to be pasted every 3 spaces. For example, if something is pasted in (1,3), then the next item will be pasted in (1,6).

Thank you so much for your help.

2 replies

Posts
2818
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
October 18, 2021
486
Hi Futurepsych92,

Here you go:
Sub RunMe()
Dim x As Integer

Sheets("Sheet1").Select

For Each cell In Range("A1:A15")
    x = x + 3
    cell.Copy Sheets("Sheet2").Cells(1, x)
Next cell
End Sub 


Best regards,
Trowa
8
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2821 users have said thank you to us this month

Posts
10
Registration date
Monday January 4, 2016
Status
Member
Last seen
February 19, 2016

It works! Thank you so much!
Posts
10
Registration date
Monday January 4, 2016
Status
Member
Last seen
February 19, 2016

Hi Trowa,

I have a quick question:


While the Macro works, I need for it to copy every four spaces starting from Cell (2,2).

So, it would be Cell (2,2), then (2,6), then (2,10)....


How would I alter this Macro to make it do this?
  • I apologize, I accidentally made a mistake in my original request for help. :(
Posts
2818
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
October 18, 2021
486
Hi Futurepsych92,

Apology accepted :).


Here you go:
Sub RunMe()
Dim x As Integer

Sheets("Sheet1").Select
x = 2

For Each cell In Range("A1:A15")
    cell.Copy Sheets("Sheet2").Cells(2, x)
    x = x + 4
Next cell
End Sub


Best regards,
Trowa
8
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2821 users have said thank you to us this month

Posts
10
Registration date
Monday January 4, 2016
Status
Member
Last seen
February 19, 2016

Thanks!