hi again atm im using this code
but i have few more cells to check and color them in red like one in code... the cells i need to check is c4:c8, i try to do something but i colored a1:r18 any one have suggestion?
Code:
Private Function Provera() As Boolean
Dim S1 As String, S2 As String
Dim lRow As Long, i As Long
Dim ws As Worksheet
Set ws = ActiveWorkbook.Sheets("pppdp")
With ws
If Application.WorksheetFunction.CountA(.Cells) <> 0 Then
lRow = .Range("A:R").Find(What:="*", _
After:=.Range("A19"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
Else
lRow = 1
End If
Provera = Application.WorksheetFunction.CountA(.Range("A19:R" & lRow)) _
= .Range("A19:R" & lRow).Cells.Count
End With
With Sheets("pppdp")
ActiveSheet.Unprotect Password:="markop"
.Range("A19:R" & .Range("A" & Rows.Count).End(xlUp).Row).Interior.ColorIndex = xlNone
End With
End Function
Sub color()
ActiveSheet.Unprotect Password:="markop"
With Sheets("pppdp")
.Range("A19:R" & .Range("A" & Rows.Count).End(xlUp).Row).Interior.ColorIndex = xlNone
If Not Provera Then
.Range("A19:R" & .Range("A" & Rows.Count).End(xlUp).Row).SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
End If
End With
ActiveSheet.Protect Password:="markop"
End Sub