Réorganiser datatables dans une colonne

Existe-t-il un moyen d'organiser automatiquement ces données?

entrez la description de l'image ici

Dans ce

entrez la description de l'image ici

Utilisation de excel / google sheets / etc. Fondamentalement, j'ai une énorme list de files (deuxième colonne) que je dois mapper à son dossier respectif (ID de la première colonne).

Ce dont j'ai besoin, c'est de copyr datatables de la colonne A vers le bas, mais seulement sur les cellules vierges immédiatement en dessous, puis de le faire à nouveau pour l'identifiant du nouveau dossier, et ainsi de suite.

Je trouve une macro qui indique à l'user quelle colonne pour copyr datatables vers le bas. Voir ci-dessous (notez que vous devrez peut-être modifier autant que nécessaire):

Sub GEN_USE_Copy_Data_Down() Dim screenRefresh$, runAgain$ Dim lastRow&, newLastRow& Dim c As Range Dim LastRowCounter$ Dim columnArray() As Ssortingng screenRefresh = MsgBox("Turn OFF screen updating while macro runs?", vbYesNo) If screenRefresh = vbYes Then Application.ScreenUpdating = False Else Application.ScreenUpdating = True End If Dim EffectiveDateCol As Integer LastRowCounter = InputBox("What column has the most data (this info will be used to find the last used row") CopyAgain: With ActiveSheet lastRow = .UsedRange.Rows.Count End With ' THIS WILL ASK THE USER TO SELECT THE COLUMN TO COPY DATA DOWN MsgBox ("Now, you will choose a column, and that column's data will be pasted in the range" & vbCrLf & "below the current cell, to the next full cell") Dim Column2Copy As Ssortingng Column2Copy = InputBox("What columns (A,B,C, etc.) would you like to copy the data of? Use SPACES, to separate columns") columnArray() = Split(Column2Copy) Dim startCell As Range For i = LBound(columnArray) To UBound(columnArray) Debug.Print i Column2Copy = columnArray(i) Set startCell = Cells(1, Column2Copy).End(xlDown) Do While startCell.row < lastRow If startCell.End(xlDown).Offset(-1, 0).row > lastRow Then newLastRow = lastRow Else newLastRow = startCell.End(xlDown).Offset(-1, 0).row End If Set CopyFrom = startCell Range(Cells(startCell.row, Column2Copy), Cells(newLastRow, Column2Copy)).Value = CopyFrom.Value Set startCell = startCell.End(xlDown) Loop Next i If screenRefresh = vbYes Then Application.ScreenUpdating = True Else Application.ScreenUpdating = True End If End Sub 

Je l'ai écrit il y a quelque time, donc il pourrait être capable de supprimer ou de combiner des lignes, mais cela devrait fonctionner (en supposant que vous essayez simplement de copyr datatables dans la colonne A).

Dans Excel, select la colonne de gauche, HOME> Modifier, Rechercher et sélectionner, Aller à Spécial …, cochez Blanks (uniquement), OK, puis select l'une des cellules choisies, = , Haut , Ctl + Entrée .