View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Assistance in transposing multiple sets of data

Hi Mark,

Am Fri, 11 Aug 2017 04:06:51 -0700 (PDT) schrieb Living the Dream:

I ran your code and it worked kind of, but I think it did not work in-part because I did not fully express exactly what I was trying to achieve.

Below is a breakdown of just ( week 1 ) what I am attempting to do, the Step spacing remains the same.


try:

Sub TransposeTable()
Dim rng1 As Range
Dim i As Integer, rowsC1 As Integer
Dim Lrow As Long, j As Long
Dim varRows As Variant

varRows = Array(9, 27, 57, 75) 'the start rows of the groups

With Sheets("Sheet1")
Lrow = .Cells(.Rows.Count, "A").End(xlUp).Row
For j = LBound(varRows) To UBound(varRows) 'loop through the rows
For i = 1 To 31 Step 6 'loop through the columns
Set rng1 = .Cells(varRows(j), i).Resize(IIf(Application.IsEven(j), 14, 20), 6)
rowsC1 = rng1.Rows.Count
Sheets("Sheet2").Cells(Rows.Count, "B").End(xlUp)(2) _
.Resize(rowsC1, 6).Value = rng1.Value '
Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp)(2) _
.Resize(rowsC1) = .Cells(varRows(j) - IIf(Application.IsEven(j), 2, 20), i + 1)
Next
Next
End With
End Sub

If the code doesn't work for you send me a mail. Then I send you my
workbook. You can look if the layout differs and modify the steps as
expected.


Regards
Claus B.
--
Windows10
Office 2016