I have this code which is all good.
This is the other code which checks the conditions in the sheet.
1) The 1st code works well if the sheet is not available which is perfect
2) But if the sheet is available then it should check the conditions (code 2)
VBA Code:
On Error Resume Next
Call HistoricalRawData
On Error Resume Next
Call SkillDailyRawData
This is the other code which checks the conditions in the sheet.
1) The 1st code works well if the sheet is not available which is perfect
2) But if the sheet is available then it should check the conditions (code 2)
Code:
Sub HistoricalRawData()
Sheets("Historical All Fields Raw Data ").Select
If ActiveSheet.Range("I2").Value <> "Longest Queued" Then
MsgBox "Incorrect Raw file selected for Historical All Fields Raw Data" & vbNewLine & vbNewLine & "Please Check the Historical All Fields Raw Data Raw file and Download the file again", vbCritical, "Historical All Fields Raw Data"
Sheets(Array("Historical All Fields Raw Data ")).Select
Sheets("Historical All Fields Raw Data ").Activate
Application.DisplayAlerts = False
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True
Sheets("Report").Select
Exit Sub
End If
End sub
Sub SkillDailyRawData()
Sheets("Skill Daily Historical V1.0-Ski").Select
If ActiveSheet.Range("E2").Value <> "Handle Time" Then
MsgBox "Incorrect Raw file selected for Skill Daily Raw Data" & vbNewLine & vbNewLine & "Please Check the Skill Daily Raw Data and Download the file again", vbCritical, "Skill Daily Raw Data"
Sheets(Array("Skill Daily Historical V1.0-Ski")).Select
Sheets("Skill Daily Historical V1.0-Ski").Activate
Application.DisplayAlerts = False
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True
Sheets("Report").Select
Exit Sub
End If
End Sub