For some reason, the code below isn't moving on to the Else statement when the value of R26 isn't > 0. Can someone help me understand where I went wrong in my code please?
Code:
Sub Assign_MD1()
Application.ScreenUpdating = False
Dim mTP, mSumm, mMD1 As Worksheet
Dim Response As VbMsgBoxResult
Set mTP = ThisWorkbook.Sheets("Total_Population")
Set mSumm = ThisWorkbook.Sheets("Summaries")
Set mMD1 = ThisWorkbook.Sheets("MD1")
If mTP.FilterMode = True Then mTP.ShowAllData
'If Len(frm_IntakeHome.cobo_ImportType.Value) = 0 Then
' MsgBox "Please enter the import type you are processing."
' If Response = vbOK Then frm_IntakeHome.cobo_ImportType.SetFocus
' Cancel = True
' Exit Sub
'Else
If mSumm.Range("R26").Value > 0 Then
Response = MsgBox("Please review the records that show as past SLA, and make any necessary corrections.", vbOKCancel)
If Response = vbOK Then
With mTP
On Error Resume Next
.UsedRange.AutoFilter Field:=8, Criteria1:="<" & Date
.UsedRange.AutoFilter Field:=13, Criteria1:="Y"
End With
mTP.Activate
'Exit Sub
Else
If mTP.FilterMode = True Then mTP.ShowAllData
SortAscending mTP, "J1", "M1"
With mTP
On Error Resume Next
.UsedRange.AutoFilter Field:=10, Critiera1:=""
.UsedRange.AutoFilter Field:=13, Critiera1:="Y"
End With
End If
End If
mTP.Activate
Application.ScreenUpdating = True
End Sub