filmov
tv
Unstacking Records with 4 Stunning Methods: Power Query vs. Dynamic Arrays vs. Functions vs. VBA
Показать описание
In this Amazing tutorial I show you how to unstack records: What is Unstacking?
We commonly have data in Excel where records are piled on top of each other in one column. unstacking means organizing your data in a list where each complete record is on a different row. By unstacking data, we are able to sort, filter or create pivot tables to analyze our data
You can download the exercise file and follow along by clicking on the link:
and I’ll be using four different Methods
I will show you how to do that by using an index and Match functions in a very creative method.
If you have never created a code in VBA I will guide you step by step on creating a simple code that can unstack your data
I will then unstack my records by using the magic of Power Query.
And finally, the fastest, laziest and most robust method by using Dynamic Arrays.
You can go directly to a specific method by clicking on the Timeline as follows:
1- Using Functions 01:08 min
2- Using a VBA Code 07:42 min
3- Using Power Query 22:43 min
4- Using Dynamic Arrays 29:13 min
In the VBA worksheet you will find the code I created, you can simply copy it and paste it in the visual basic editor.
Here is the VBA code another time:
Sub FixRecords()
Dim MyRecords As Integer
Dim FixRange As Range
Dim PasteCell As Integer
Dim Loopcounter As Integer
Range(“E2“). Resize(200,10).ClearContents
MyRecords = Range("B1", Range("B1").End(xlDown)).Count
Range("B1").Select
For Loopcounter = 1 To MyRecords Step 10
Set FixRange = Range(Cells(Loopcounter, 2), Cells(Loopcounter, 2).Offset(9, 0))
FixRange.Copy
PasteCell = ActiveSheet.Cells(Rows.Count, 5).End(xlUp).Row + 1
Cells(PasteCell, 5).PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= False, Transpose:=True
Next Loopcounter
Range(“E2”).select
End Sub
I added an Extra worksheet “Did You Watch” with links to some of my popular video Tutorials.
Finally, it motivates me to read your comments ...and don’t forget to hit the Subscribe button to be notified when new tutorials are posted… The Best is yet to come!
We commonly have data in Excel where records are piled on top of each other in one column. unstacking means organizing your data in a list where each complete record is on a different row. By unstacking data, we are able to sort, filter or create pivot tables to analyze our data
You can download the exercise file and follow along by clicking on the link:
and I’ll be using four different Methods
I will show you how to do that by using an index and Match functions in a very creative method.
If you have never created a code in VBA I will guide you step by step on creating a simple code that can unstack your data
I will then unstack my records by using the magic of Power Query.
And finally, the fastest, laziest and most robust method by using Dynamic Arrays.
You can go directly to a specific method by clicking on the Timeline as follows:
1- Using Functions 01:08 min
2- Using a VBA Code 07:42 min
3- Using Power Query 22:43 min
4- Using Dynamic Arrays 29:13 min
In the VBA worksheet you will find the code I created, you can simply copy it and paste it in the visual basic editor.
Here is the VBA code another time:
Sub FixRecords()
Dim MyRecords As Integer
Dim FixRange As Range
Dim PasteCell As Integer
Dim Loopcounter As Integer
Range(“E2“). Resize(200,10).ClearContents
MyRecords = Range("B1", Range("B1").End(xlDown)).Count
Range("B1").Select
For Loopcounter = 1 To MyRecords Step 10
Set FixRange = Range(Cells(Loopcounter, 2), Cells(Loopcounter, 2).Offset(9, 0))
FixRange.Copy
PasteCell = ActiveSheet.Cells(Rows.Count, 5).End(xlUp).Row + 1
Cells(PasteCell, 5).PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= False, Transpose:=True
Next Loopcounter
Range(“E2”).select
End Sub
I added an Extra worksheet “Did You Watch” with links to some of my popular video Tutorials.
Finally, it motivates me to read your comments ...and don’t forget to hit the Subscribe button to be notified when new tutorials are posted… The Best is yet to come!
Комментарии