Created
April 2, 2018 04:44
-
-
Save DuongAQ/91ced41ee049ab4241f992bfe33e72ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Transpose_Range() | |
Dim i As Long | |
Dim SoDong As Integer 'Độ rộng của mỗi nhóm = số dòng | |
SoDong = 4 | |
With [A1:D17] 'Vùng cần transpose | |
For i = 2 To [A65536].End(xlUp).Row Step SoDong 'Thực hiện việc copy theo từng nhóm dựa vào số dòng | |
Union(.Rows(i), .Rows(i).Resize(SoDong)).Copy 'Vùng cần copy từ dòng i tới dòng cuối trong nhóm đó | |
Sheet1.Range("A" & Rows.Count).End(xlUp)(1).PasteSpecial Transpose:=True 'Nơi dán kết quả transpose | |
Next | |
End With | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment