so nochmal rückmeldung von mir
klappt nun alles so wie ich will
die vorlage kann man ja einfach temporär als normal.dot einbinden
den code habe ich dahingehened verändert, das er mit dem move befehl an die entsprechende stelle geht
Sub WDErstellung()
Dim objWA As Object, objWD As Object
Dim intRow As Integer
Dim lngCount As Integer
Dim strScratch As String, strText As String
Dim strPfad As String, strName As String
intRow = 14 'QuellSpalte (hier A)
strPfad = "C:\Test2\" 'Pfad muss in diesem Beispiel existieren
strText = "" 'zu schreibender Text
strName = "FRD " 'Name der Dateien
Set objWA = CreateObject("Word.application") 'Word öffnen
'objWA.Visible = True 'falls man zuschauen möchte
With ThisWorkbook.ActiveSheet
For lngCount = 1 To .Cells(Rows.Count, intRow).End(xlUp).Row
If .Cells(lngCount, intRow).Value <> "" And IsNumeric(.Cells(lngCount, intRow).Value) Then
strScratch = .Cells(lngCount, intRow).Value
Set objWD = objWA.documents.Add
With objWA
.Selection.Move Count:=37
.Selection.Delete Count:=9
.Selection.Font.Name = "Calibri"
.Selection.Font.Size = 16
.Selection.Font.Underline = False
.Selection.TypeText Text:=strText & strScratch
End With
objWD.SaveAs (strPfad & strName & strScratch & ".doc") 'WD speichern
objWD.Close 'WD schließen
End If
Next lngCount
End With
objWA.Quit 'Word-Anwendung schliessen
End Sub
von daher nochmals vielen dank für den code und die anregung
mfg der-bettler