#### SV18

##### Board Regular
Hi All,

Can someone help me with the following please?

I need to take the headers and the data from the criteria columns and and transpose them to sheet2, I need to do this for each individual ref number in column A.

The data currently looks like this:

 Ref Criteria 1 Criteria 2 Criteria 3 Criteria 4 Criteria 5 Criteria 6 F20180 Sam N/A N/A Sam 28/05/1988 Live F20181 Sam N/A N/A Sam 28/05/1988 Live F20184 Sam N/A N/A Sam 28/05/1988 Live F20204 Sam N/A N/A Sam 06/04/1988 Live

<TBODY>
</TBODY>

I need it to look like this:
 Ref Service Data F20180 Criteria 1 Sam F20180 Criteria 2 N/A F20180 Criteria 3 N/A F20180 Criteria 4 Sam F20180 Criteria 5 32291 F20180 Criteria 6 Live

<TBODY>
</TBODY>

### Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Hi,
let Your Data be in Columns A:G, then try to use the macro of the form:
Code:
``````Sub Makro()
Dim i&, j&, x&

For i = 2 To Cells(Rows.Count, 1).End(xlUp).Row
For j = 1 To 6
x = x + 1
Cells(x, 8).Value = Cells(i, 1).Value
Cells(x, 9).Value = "Criteria" & j
Cells(x, 10).Value = Cells(i, j + 1).Value
Next j
Next i
End Sub``````
Best regards.

Last edited:
Thanks for the reply...unfortunately the dataset I added to the above is only a tiny example of the range I really need to query, so I'm not too sure if this code is going to work on a larger dataset.

Maybe use arrays to find better Solution. I think, that this is possible, best regards.

The actual range is from B to IB, and the reference number in column A goes down to A633.

Do you think you can help now you know the ranges?

I think, that in Your case the Solution without arrays is good enough, try the macro:
Code:
``````Sub Makro()
Dim i&, j&, x&

With Worksheets("Sheet2")
For i = 2 To Cells(Rows.Count, 1).End(xlUp).Row
For j = 1 To 236
x = x + 1
.Cells(x, 1).Value = Cells(i, 1).Value
.Cells(x, 2).Value = "Criteria" & j
.Cells(x, 3).Value = Cells(i, j + 1).Value
Next j
Next i
End With

End Sub``````
Best regards.

Thanks once again but unfortunately this isn't working. I feel like all I need is some code that takes B2:IB2, transposes it as values into sheet2. Then takes the relevent line of data, transposes that as values into column C of sheet2 and replicates this for each reference number.

I tested the above macro in my WorkSheet and it is working. You have to activate it in Sheet1... It may be Your problem... Best regards.

Replies
1
Views
367
Replies
0
Views
1K
Replies
6
Views
362
Replies
8
Views
292
Replies
0
Views
2K

1,211,802
Messages
6,104,055
Members
447,892
Latest member

### 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.

### Which adblocker are you using?

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

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