Forum Discussion
himanshujoshi2211
Nov 09, 2024Copper Contributor
adjust my data
i have mix data with dates and stock names but i want to adjust my data like what i show in picture. and i have huge amount of data. i just want to adjust my data date wise.
OliverScheurich
Nov 09, 2024Gold Contributor
Sub adjust()
Dim i As Long, j As Long
i = Range("A" & Rows.Count).End(xlUp).Row
For j = i To 2 Step -1
If Cells(j, 1).Value = Cells(j - 1, 1).Value Then
Else
Rows(j).Insert
End If
Next j
End Sub
You can run this macro which should return the intended result. The assumption is that the data is sorted by the dates in column A before running the macro.