gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,347
- Office Version
- 365
- Platform
- Windows
I have spent the last hour looking at this to see where the problem is.
I need to look across row 5, starting in column 6 (F) and if the its not Balnk look at column 5 and see if its value is not null. If it is Null, then delete whats in column 5
Now column 5 typically has values further to the right than column 6 does. Those are the cells I am trying to clear
Remove unneeded Dates in Row 5
'If the cell in row 6 is blank delete data in row 5
Dim i As Long
Dim LastCol As Long
With Sheets("Monthly Allocation Report")
LastCol = .Cells(5, .Columns.Count).End(xlUp).Column
End With
With Sheets("Monthly Allocation Report")
For i = 5 To LastCol
If Len(.Cells(6, i).Value) > 1 Then
.Cells(5, i).Clear
End If
Next i
End With
I need to look across row 5, starting in column 6 (F) and if the its not Balnk look at column 5 and see if its value is not null. If it is Null, then delete whats in column 5
Now column 5 typically has values further to the right than column 6 does. Those are the cells I am trying to clear
Remove unneeded Dates in Row 5
'If the cell in row 6 is blank delete data in row 5
Dim i As Long
Dim LastCol As Long
With Sheets("Monthly Allocation Report")
LastCol = .Cells(5, .Columns.Count).End(xlUp).Column
End With
With Sheets("Monthly Allocation Report")
For i = 5 To LastCol
If Len(.Cells(6, i).Value) > 1 Then
.Cells(5, i).Clear
End If
Next i
End With