Ich hab mal mit folgendem versucht
If NOT ((sPlaceholder Like "") OR (sPlaceholder Like "s Mitglied")) Then [mach was] Else [mach was anderes]
Dennoch schreibt der mir nicht "leer" rein.
'-< Replace all Placeholders >-
Dim sText As String
sText = sTemplate
Dim iCol As Integer
For iCol = 1 To tblEmails.ListColumns.Count
Dim sPlaceholder As String
sPlaceholder = tblEmails.Range(1, iCol)
sPlaceholder = Trim(sPlaceholder)
Dim sValue As String
sValue = tblEmails.Range(iRow, iCol)
sValue = Trim(sValue)
'< replace >
If Not ((sPlaceholder Like "") Or (sPlaceholder Like "s Mitglied")) Then
'If Not sPlaceholder Like "" Then
sText = Replace(sText, "[@" & sPlaceholder & "]", sValue, , , vbTextCompare)
Else
sText = Replace(sText, "[@Anrede]", sValue, , , vbTextCompare)
sText = Replace(sText, "[@Alter]", sValue, , , vbTextCompare)
sText = Replace(sText, "[@Vorname]", "", , , vbTextCompare)
sText = Replace(sText, "[@Name]", "", , , vbTextCompare)
End If
'</ replace >
Next
'-</ Replace All Placeholders >-
|