Excel Challenge

5625 pts.
Tags:
Microsoft Excel
Let's say that I have an Excel spreadsheet that contains a long list in column A. How might I go about taking every 40 items in column A and moving it to its own column? For example, A1:A40 remains in column A; A41:80 gets moved to column B and so on. I'm not looking for a thought process but rather code samples, if available.

Answer Wiki

Thanks. We'll let you know when a new response is added.

This Excel Macro should do the trick for you.

<pre> Dim i As Integer
Dim j As Integer
i = 2
j = 41
Do Until Range(“A” & j).Value = “”
Range(“A” & j & “:A” & j + 39).Select
Selection.Cut
Range(Chr(i + 64) & “1”).Select
ActiveSheet.Paste
j = j + 40
i = i + 1
Loop</pre>

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: