Enzo_Matrix
Board Regular
- Joined
- Jan 9, 2018
- Messages
- 113
I have this code supplied by a board regular and it works perfectly apart from one minor bug.
I have a table being used for our production schedule with the date as the main focal point. This table is updated regularly throughout each day and items are both removed and added. The code is supposed to add a blank line at the end of each week to better seperate our work load.
This code is adding additional blank lines though and I have to manually delete them. Is there a way to either have some script delete the last row for me or to modify this code so that it will do it on its own?
I have a table being used for our production schedule with the date as the main focal point. This table is updated regularly throughout each day and items are both removed and added. The code is supposed to add a blank line at the end of each week to better seperate our work load.
Code:
Dim i As Long
Col = "G"
For i = LR To 5 Step -1 If Cells(i, Col).Value >= Date Then
On Error Resume Next
If Cells(i, Col).Value - Cells(i - 1, Col).Value > 1 Then
On Error GoTo 0
Cells(i, Col).EntireRow.Insert
End If
End If
Next i
This code is adding additional blank lines though and I have to manually delete them. Is there a way to either have some script delete the last row for me or to modify this code so that it will do it on its own?