Hi, laxminarayana,
thanks. Please check if WorksheetFunction,Countif will work for you:
Sub textauto()
Dim ws1 As Worksheet: Set ws1 = Sheets("Sheet1")
Dim ws2 As Worksheet: Set ws2 = Sheets("Sheet2")
Dim ws3 As Worksheet: Set ws3 = Sheets("Sheet3")
With ws2.Range("D1")
If WorksheetFunction.CountIf(ws3.Range("D12:D28"), ws1.Range("A6").Value) > 0 Then
If .Value = "" Then
.Value = "Please assign the documents after three days"
Else
.Value = .Value & vbLf & vbLf & "Please assign the documents after three days"
End If
Else
If .Value = "" Then
.Value = "Please assign the documents immediately"
Else
.Value = .Value & vbLf & vbLf & "Please assign the documents immediately"
End If
End If
End With
Set ws3 = Nothing
Set ws2 = Nothing
Set ws1 = Nothing
End Sub
Ciao,
Holger
Bookmarks