Hi! I don't have much time to browse through the posts that might be able to help me, so I'm posting a file similar to the one I'm working with.
I'd like to get help with working out with a vba code that'll be able to transpose data vertically.
Hi! I don't have much time to browse through the posts that might be able to help me, so I'm posting a file similar to the one I'm working with.
I'd like to get help with working out with a vba code that'll be able to transpose data vertically.
Hi, try it
![]()
Sub ertert() Dim x, y(), i&, j&, k& x = Sheets("Sheet1").Range("A1").CurrentRegion.Value ReDim y(1 To UBound(x) * UBound(x, 2), 1 To 3) For i = 2 To UBound(x) For j = 2 To UBound(x, 2) Step 2 If Len(x(i, j)) Then k = k + 1 y(k, 1) = x(i, 1): y(k, 2) = x(i, j): y(k, 3) = x(i, j + 1) End If Next j Next i With Sheets("Sheet2") .UsedRange.ClearContents .Range("A1:C1").Value = Array("Company", "b", "c") .Range("A2:C2").Resize(k).Value = y: .Activate End With End Sub
works magic! thank you!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks