Code:
Do
Set dayPlan = rowA.FindNext(After:=dayPlan)
If Not dayPlan Is Nothing Then
If dayCheck.Address = dayPlan.Address Then
Exit Do
End If
Else
Exit Do
End If
offsetOfToday = dayPlan.Offset(0, 3)
offsetOfDue = dayPlan.Offset(0, 4)
Set asOf = offsetCol.Find(What:=offsetOfToday, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
Set dueDay = offsetCol.Find(What:=offsetOfDue, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
Letters = Split(Replace(dayPlan.Offset(0, 1).Value, " ", ""), ",")
For X = 0 To UBound(Letters)
Select Case Letters(X)
Case "C"
'bizRhyth.Range("g9").Offset(testestest, 0) = dayPlan.Offset(0, 2) these statements are used for testing box
Application.ScreenUpdating = False
message = dayPlan.Offset(0, 2)
Set lync = Messenger.InstantMessage(CAMx)
lync.SendText (message)
message = dayPlan.Offset(0, 2)
lync.SendText (message)
If dayPlan.Offset(0, 3) = 0 Then
message = "As of: Today"
ElseIf dayPlan.Offset(0, 3) = -1 Then
message = "As of: Yesterday"
Else
message = "As of: " & asOf
End If
lync.SendText (message)
If dayPlan.Offset(0, 4) = 1 Then
message = "Due: Close of business"
ElseIf dayPlan.Offset(0, 4) = 2 Then
message = "Due: Tomorrow"
Else
message = "Due: " & dueDay
End If
lync.SendText (message)
On Error Resume Next
lync.Close
Application.ScreenUpdating = True
Case "F"
'bizRhyth.Range("H9").Offset(testestest, 0) = dayPlan.Offset(0, 2)
Application.ScreenUpdating = False
message = dayPlan.Offset(0, 2)
Set lync = Messenger.InstantMessage(FinPMx)
lync.SendText (message)
message = dayPlan.Offset(0, 2)
lync.SendText (message)
If dayPlan.Offset(0, 3) = 0 Then
message = "As of: Today"
ElseIf dayPlan.Offset(0, 3) = -1 Then
message = "As of: Yesterday"
Else
message = "As of: " & asOf
End If
lync.SendText (message)
If dayPlan.Offset(0, 4) = 1 Then
message = "Due: Close of business"
ElseIf dayPlan.Offset(0, 4) = 2 Then
message = "Due: Tomorrow"
Else
message = "Due: " & dueDay
End If
lync.SendText (message)
On Error Resume Next
lync.Close
Application.ScreenUpdating = True
Case "P"
'bizRhyth.Range("I9").Offset(testestest, 0) = dayPlan.Offset(0, 2)
Application.ScreenUpdating = False
message = dayPlan.Offset(0, 2)
Set lync = Messenger.InstantMessage(Planningx)
lync.SendText (message)
message = dayPlan.Offset(0, 2)
lync.SendText (message)
If dayPlan.Offset(0, 3) = 0 Then
message = "As of: Today"
ElseIf dayPlan.Offset(0, 3) = -1 Then
message = "As of: Yesterday"
Else
message = "As of: " & asOf
End If
lync.SendText (message)
If dayPlan.Offset(0, 4) = 1 Then
message = "Due: Close of business"
ElseIf dayPlan.Offset(0, 4) = 2 Then
message = "Due: Tomorrow"
Else
message = "Due: " & dueDay
End If
lync.SendText (message)
On Error Resume Next
lync.Close
Application.ScreenUpdating = True
Case "S"
'bizRhyth.Range("J9").Offset(testestest, 0) = dayPlan.Offset(0, 2)
Application.ScreenUpdating = False
message = dayPlan.Offset(0, 2)
Set lync = Messenger.InstantMessage(Subx)
lync.SendText (message)
message = dayPlan.Offset(0, 2)
lync.SendText (message)
If dayPlan.Offset(0, 3) = 0 Then
message = "As of: Today"
ElseIf dayPlan.Offset(0, 3) = -1 Then
message = "As of: Yesterday"
Else
message = "As of: " & asOf
End If
lync.SendText (message)
If dayPlan.Offset(0, 4) = 1 Then
message = "Due: Close of business"
ElseIf dayPlan.Offset(0, 4) = 2 Then
message = "Due: Tomorrow"
Else
message = "Due: " & dueDay
End If
lync.SendText (message)
On Error Resume Next
lync.Close
Application.ScreenUpdating = True
Case "0"
'bizRhyth.Range("K9").Offset(testestest, 0) = dayPlan.Offset(0, 2)
Application.ScreenUpdating = False
message = dayPlan.Offset(0, 2)
Set lync = Messenger.InstantMessage(FinOx)
lync.SendText (message)
message = dayPlan.Offset(0, 2)
lync.SendText (message)
If dayPlan.Offset(0, 3) = 0 Then
message = "As of: Today"
ElseIf dayPlan.Offset(0, 3) = -1 Then
message = "As of: Yesterday"
Else
message = "As of: " & asOf
End If
lync.SendText (message)
If dayPlan.Offset(0, 4) = 1 Then
message = "Due: Close of business"
ElseIf dayPlan.Offset(0, 4) = 2 Then
message = "Due: Tomorrow"
Else
message = "Due: " & dueDay
End If
lync.SendText (message)
On Error Resume Next
lync.Close
Application.ScreenUpdating = True
End Select
Next
Loop