Unstacking Columns

windoz

New Member
Joined
May 21, 2014
Messages
13
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Hi,

I've been looking for various ways in how I can achieve the following;

Data is going from left to right from Column A to Column M, there are many more tutors and 4 tests with each and this data goes on until Column AK maybe more.

What I want to achieve is the result or example shown in Column A, Row 10 so that the data is stacked for each student per tutor.

Any ideas in how I can progress with this ?

1625782698753.png



Many thanks.
 

Attachments

  • 1625782470875.png
    1625782470875.png
    44.5 KB · Views: 5

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
I suggest you add a tab to the Right of the original (Keeping Original data, in case you need to go back to it), then Copy the data (example above ) from Column I ~ M below in Column B, then copy your Rep IDs to column A. (you may want to consider a pivot table?)
 
Upvote 0
How about
VBA Code:
Sub windoz()
   Dim Ary As Variant, Nary As Variant
   Dim r As Long, c As Long, cc As Long, nr As Long
   
   Ary = Sheets("Sheet1").Range("A1").CurrentRegion.Value2
   ReDim Nary(1 To UBound(Ary) * UBound(Ary, 2), 1 To 8)
   
   For c = 4 To UBound(Ary, 2) Step 5
      For r = 2 To UBound(Ary)
         nr = nr + 1
         Nary(nr, 1) = Ary(r, 1)
         Nary(nr, 2) = Ary(r, 2)
         Nary(nr, 3) = Ary(r, 3)
         For cc = 0 To 4
            Nary(nr, cc + 4) = Ary(r, c + cc)
         Next cc
      Next r
   Next c
   With Sheets("Sheet2")
      .Range("A1:H1").Value = Application.Index(Ary, 1, [transpose(row(1:9))])
      .Range("A2").Resize(nr, 8).Value = Nary
   End With
End Sub
Change sheet names to suit.
 
Upvote 0
Solution
Fluff you are amazing!!!!!

Does exactly what I needed..This will save me hours worth of work!

Thank you so much.
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,641
Messages
6,125,981
Members
449,276
Latest member
surendra75

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