Forum Discussion
himanshujoshi2211
Nov 02, 2024Copper Contributor
blank row in dates
i want blank row between different dates, and dates are adjusted in column. example if first date is 20-4-2024 second date is again 20-4-2024 but third date is 25-4-2024, third date is different then...
NikolinoDE
Nov 02, 2024Platinum Contributor
Maybe try using VBA, here is an approach.
Sub InsertBlankRowsBetweenDates()
Dim ws As Worksheet
Dim lastRow As Long
Dim i As Long
' Set the worksheet
Set ws = ThisWorkbook.Sheets("Sheet1") ' Change "Sheet1" to your sheet name
' Find the last row in Column A
lastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row
' Loop from bottom to top
For i = lastRow To 2 Step -1
If ws.Cells(i, 1).Value <> ws.Cells(i - 1, 1).Value Then
ws.Rows(i).Insert Shift:=xlDown
End If
Next i
End SubMy answers are voluntary and without guarantee!
Hope this will help you.
- SelahMartinezDec 04, 2024Copper Contributor
Thank you, you saved my day.
- OliverScheurichDec 05, 2024Gold Contributor
An alternative could be Power Query. In the attached file you can add data to the blue dynamic table. Then you can click in any cell of the green table and right-click with the mouse and select refresh to update the green result table.