Sub Boddulus()
Dim i As Integer
Dim lrow As IntegerData sheet.xlsm
i = 1
lrow = ActiveSheet.UsedRange.Rows.Count
For i = 1 To lrow
If Cells(i, 11) <> "*" Then '1st rule
Range(Cells(i, 1), Cells(i, 11)).Interior.ColorIndex = 3 'color everything that is not * as red
End If
If Cells(i, 7) = 0.00001 Then '2nd rule
Range(Cells(i, 1), Cells(i, 11)).Interior.ColorIndex = 5 'color everything that is not * as blue
End If
Next
Call colordelete
End Sub
Sub colordelete()
Dim i As Integer
Dim lrow As Integer
If MsgBox("Are you sure you want to delete?", vbYesNo) = vbNo Then
Exit Sub
End If
i = 1
lrow = ActiveSheet.UsedRange.Rows.Count
Application.ScreenUpdating = False
For i = lrow To 1 Step -1
If Cells(i, 1).Interior.ColorIndex > 0 Then
Rows(i).Delete
End If
End Sub
Hi All i have the code where macro colors and deletes all unwanted data. now i want to add one more code where macro should detect if today is Monday and delete the rows which has security date as Fridays date in (column J) in the sheet. i want this to happen only on Mondays and the rest of the days the macro should run with other codes that is (Rule1 &rule 2) .can this be possible with a code in the same sheet.please find the attachment for reference. thanks in advance.....
Bookmarks