I have a worksheet where I need to validate the header content. If the headers don't match what is expected, then I need the macro to exit and show a message box with what headers were incorrect. For example:
If Range("A1").Value <> "Material" Then
a = 1
End If
If Range("B1").Value <> "Subcomponent" Then
b = 1
End If
If Range("C1").Value <> "Quantity" Then
c = 1
End If
etc.
If B1 and C1 are incorrect, I want a message box to appear before the macro exits that reads:
"Header for column B should be 'Subcomponent'
Header for column C should b 'Quantity'"
Is there any way to get a single message box to display text based on the values assigned to a, b, c, etc?
Bookmarks