Update!!
letzteZeile = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
For n = 11 To letzteZeile
If Cells(n, 1).Value = "Vorname" Then
strA = Cells(n, 2) & " " & Cells(n, 3) & vbLf
Range("B11:B100").Sort Key1:=Range("B11"), Order1:=xlAscending, Header:=xlYes
doc.Bookmarks("VorN").Range.Text = strAnforderung
ElseIf Cells(n, 1).Value = "Nachname" Then
strA2 = Cells(n, 2) & " " & Cells(n, 3) & vbLf
Range("B11:B100").Sort Key1:=Range("B11"), Order1:=xlAscending, Header:=xlYes
doc.Bookmarks("NachN").Range.Text = strA2
End If
Next n
Word Datei hier sind zwei Textmarken eingesetzt für Vorname und Nachname :
Beispiel:
Vorname
Jennifer JR
Sara S
Nachname
Müller M
Mustermann MN
|