ich habe eine Excel Mappe, aus der ich einen bestimmten Range in eine bestehende Word Angebotsvorlagendatei kopieren möchte. Das Problem ist, dass der Range nicht gleichbleibend ist, sondern sich durch die Menge der Produkte ändert. Es handelt sich um 4 Tabellen, die von VBA um die leeren Positionen der jeweiligen Tabelle gekürzt werden. Zum Verständnis hier der VBA Code der Excel Datei:
Sub KalkulationAnpassen()If Range("B145").Value = "" Then
Range("A134", "L147").Select
Selection.ClearContents
Range("A134", "L147").Select
Selection.Delete shift:=xlUp
Application.CutCopyMode = False
Else
End If
If Range("B52").Value = "" Then
Range("A90", "L133").Select
Selection.ClearContents
Range("A90", "L133").Select
Selection.Delete shift:=xlUp
Application.CutCopyMode = False
Range("A46", "L89").Select
Selection.ClearContents
Range("A46", "L89").Select
Selection.Delete shift:=xlUp
Application.CutCopyMode = False
Else
If Range("B96").Value = "" Then
Range("A90", "L133").Select
Selection.ClearContents
Range("A90", "L133").Select
Selection.Delete shift:=xlUp
Application.CutCopyMode = False
Else
End If
End If
With Sheets("Kalkulation")
Intersect(.Columns(2).SpecialCells(xlCellTypeBlanks).EntireRow, _
.Columns(11).SpecialCells(xlCellTypeFormulas, 16).EntireRow).Delete
End With
Dim objWord As Object
Dim strPfad As String
strPfad = "C:\Users\BeispielUser\Desktop\beispielUser\VisualBasic\VBA WORD"
Set objWord = CreateObject("Word.application")
With objWord
.Application.Visible = True
.Application.Documents.Open (strPfad)
End With
Set objWord = Nothing
End Sub
Das was mir der VBA code ausspuckt möchte ich jetzt nach Word kopieren. Kann mir wer helfen?
Danke im voraus!