Simple Loop

matthewjapp

Board Regular
Joined
May 14, 2007
Messages
115
Hi there I have 26 columns (A:Z) all have 2500 rows

I need to get all the columns into 1 so that after 1st loop records in A2:A2500 with colum B added becomes A2:A4999, after column c is added to A it records become A2:A7498 etc

Can anyone point me in the right directioon of my first loop?

Thanks
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Try

Code:
Sub test()
Dim i As Long
For i = 2 To 26
    Range(Cells(1, i), Cells(2500, i)).Copy Destination:=Cells(Rows.Count, 1).End(xlUp).Offset(1)
Next i
End Sub
 
Upvote 0
Code:
Sub blah2()
Destrow = 2501
For Each colm In Range("B2:Z2500").Columns
  colm.Copy Range("A" & Destrow)
  Destrow = Destrow + 2499
Next colm
'Range("B1:Z2500").Clear
End Sub
 
Upvote 0
Thank you both, I'm going to not only use this in my work, but use this as my foundation for future loop programming, thanks again, Matthew
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,476
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top