Hi,
I have found a macro that does convert columns into rows, bur when i load the data from a sharepoint-source, than i got a table and than the macro doesn't work.
The macro is :
I got an error at the first if. I could, convert the table into a list, but then i lost the connection to the original data source.
Is there a solution?
Thanks,
Fred
I have found a macro that does convert columns into rows, bur when i load the data from a sharepoint-source, than i got a table and than the macro doesn't work.
The macro is :
VBA Code:
Code:
Sub test()
myColumns = 7 'Number of columns to the right of A on sheet1
myRow1 = 2 'First row of data on sheet1
myRow2 = 1 'First row of list on sheet2
Do
If Range("Sheet1!A" & myRow1).Value = "" Then Exit Do
For n = 1 To myColumns
Range("Sheet2!A" & myRow2).Value = Range("Sheet1!A" & myRow1).Value
Range("Sheet2!B" & myRow2).Value = Range("Sheet1!A1").Offset(0, n).Value
Range("Sheet2!C" & myRow2).Value = Range("Sheet1!A" & myRow1).Offset(0, n).Value
myRow2 = myRow2 + 1
Next n
myRow1 = myRow1 + 1
Loop
End Sub
I got an error at the first if. I could, convert the table into a list, but then i lost the connection to the original data source.
Is there a solution?
Thanks,
Fred