vangog
12-26-2021, 02:34 PM
What do you suggest to change to check for errors?
SexColNo = Application.Match("Pohlavi", SourceHeaders, 0)
If Error = 2042 Then
MsgBox "Header Pohlavi not found in source table."
Err.Clear
End If
StateColNo = Application.Match("Stav", SourceHeaders, 0)
If Error = 2042 Then
MsgBox "Header Stav not found in source table."
Err.Clear
End If
AgeColNo = Application.Match("Vek", SourceHeaders, 0)
If Error = 2042 Then
MsgBox "Header Vek not found in source table."
Err.Clear
End If
SexColNo = Application.Match("Pohlavi", SourceHeaders, 0)
If Error = 2042 Then
MsgBox "Header Pohlavi not found in source table."
Err.Clear
End If
StateColNo = Application.Match("Stav", SourceHeaders, 0)
If Error = 2042 Then
MsgBox "Header Stav not found in source table."
Err.Clear
End If
AgeColNo = Application.Match("Vek", SourceHeaders, 0)
If Error = 2042 Then
MsgBox "Header Vek not found in source table."
Err.Clear
End If