If condition

vmjan02

Well-known Member
Joined
Aug 15, 2012
Messages
1,059
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
I don't know as how to do the if condition
As need to check every cell value in one

VBA Code:
If ActiveSheet.Range("a2").Value <> "Skill Group Name" Then
If ActiveSheet.Range("b2").Value <> "Date" Then
If ActiveSheet.Range("C2").Value <> "Avg Speed of Answer" Then
If ActiveSheet.Range("D2").Value <> "Avg Abandon Time" Then
If ActiveSheet.Range("E2").Value <> "Handled" Then
If ActiveSheet.Range("F2").Value <> "Avg Handle Time" Then
If ActiveSheet.Range("G2").Value <> "Avg Wrap Time" Then
If ActiveSheet.Range("H2").Value <> "Abandon" Then
If ActiveSheet.Range("I2").Value <> "Longest Queued" Then
If ActiveSheet.Range("J2").Value <> "Dequeued" Then
If ActiveSheet.Range("K2").Value <> "%Handle Time" Then
If ActiveSheet.Range("L2").Value <> "%Answer" Then
If ActiveSheet.Range("M2").Value <> "Max Queued" Then
If ActiveSheet.Range("N2").Value <> "Handle Time" Then
MsgBox "Check Historical Raw file" & vbNewLine & "Header MisMatch"
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Sub
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
How about
VBA Code:
Sub vmjan()
   Dim Txt As String
   Txt = "Skill Group Name|Date|Avg Speed of Answer|Avg Abandon Time|Handled|Avg Handle Time|Avg Wrap Time|Abandon|Longest Queued|Dequeued|%Handle Time|%Answer|Max Queued|Handle Time"
   If Join(Application.Index(Range("A2:N2").Value, 1, 0), "|") <> Txt Then
      MsgBox "Check Historical Raw file" & vbNewLine & "Header MisMatch"
   End If
End Sub
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,935
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top