maybe something like this
not tested and just done off the cuff
Sub test()
On Error GoTo ErrHandler
SexColNo = Application.Match("Pohlavi", SourceHeaders, 0)
If IsError(SexColNo) Then Err.Raise 1000, "My Prog", "Header Pohlavi not found in source table."
StateColNo = Application.Match("Stav", SourceHeaders, 0)
If IsError(StateColNo) Then Err.Raise 1001, "My Prog", "Header Stav not found in source table."
AgeColNo = Application.Match("Vek", SourceHeaders, 0)
If IsError(AgeColNo) Then Err.Raise 1002, "My Prog", "Header Vek not found in source table."
'must be OK so do the rest
Exit Sub
ErrHandler:
'optional
Select Case Err.Number
Case 1000
'any special processing
Case 1001
'any special processing
Case 1002
'any special processing
End Select
MsgBox Err.Description
End Sub