S
Scott
Hello-
I am having trouble getting the "then" portion of my statement not to
happen when both IF conditions are not met. The value of ("J29:K29")
is 3590 and B6 is 31600. Since both conditions are not met, I dont
want the message to appear in D21, but it does regardless.
Private Sub Breaks()
Dim myCell As Range
Set myCell = Selection
Dim ws As Worksheet
Set ws = Worksheets("AgentReport")
On Error Resume Next
If Range("J29:K29").Value > 3600 And Range("B6").Value > 21600 Then
Range("d21").Select
ActiveCell.FormulaR1C1 = "" & ws.Range("d3").Value & ", please make
sure to keep your Break/Lunch time under 1 hour. Thank you."
ElseIf Range("J29:K29").Value < 3600 And Range("B6").Value > 21600
Then
Range("d21").Select
ActiveCell.FormulaR1C1 = ""
End If
myCell.Select
End Sub
I am having trouble getting the "then" portion of my statement not to
happen when both IF conditions are not met. The value of ("J29:K29")
is 3590 and B6 is 31600. Since both conditions are not met, I dont
want the message to appear in D21, but it does regardless.
Private Sub Breaks()
Dim myCell As Range
Set myCell = Selection
Dim ws As Worksheet
Set ws = Worksheets("AgentReport")
On Error Resume Next
If Range("J29:K29").Value > 3600 And Range("B6").Value > 21600 Then
Range("d21").Select
ActiveCell.FormulaR1C1 = "" & ws.Range("d3").Value & ", please make
sure to keep your Break/Lunch time under 1 hour. Thank you."
ElseIf Range("J29:K29").Value < 3600 And Range("B6").Value > 21600
Then
Range("d21").Select
ActiveCell.FormulaR1C1 = ""
End If
myCell.Select
End Sub