If Sheets("Grunddefinition").Range("T5").Value <> 0 Or Sheets("Grunddefinition").Range("T5").Value <> "" Then
Dim A As String
A = Application.IfError(Application.VLookup(Sheets("Grunddefinition").Range("S5"), Sheets("Grunddefinition").Range("S5:T5"), 2, False), "")
Dim x As String
x = Dir("S:archiv\LOGO\" & A & ".png") 'Or x = Dir("S:archiv\LOGO\" & A & ".jpg")
If x <> "" Then
Set p = ActiveSheet.Pictures.Insert("S:archiv\LOGO\" & A & ".png") 'Or x = Dir("S:archiv\LOGO\" & A & ".jpg")
Set C = Sheets("Grunddefinition").Range("S1") And Sheets("Zeitablaufplan").Range("B5") And Sheets("Zeitablaufplan").Range("M5") And Sheets("Zeitablaufplan").Range("X5") And Sheets("Zeitablaufplan").Range("AI5")
ElseIf x = "" Then
MsgBox "Error! Can't find the corresponding picture!"
MsgBox "You should check whether the picture is existing in the folder of Logo or check the name of the picture is corresponded with the name of customer!"
End If
ElseIf Sheets("Grunddefinition").Range("T3").Value = 0 Or Sheets("Grunddefinition").Range("T3").Value = "" Then
Set C = Sheets("Grunddefinition").Range("S1") And Sheets("Zeitablaufplan").Range("B5") And Sheets("Zeitablaufplan").Range("M5") And Sheets("Zeitablaufplan").Range("X5") And Sheets("Zeitablaufplan").Range("AI5")