Option
Explicit
Sub
Export_Data()
Dim
wdApp
As
Object
Dim
wdDoc
As
Object
Dim
wdRange
As
Object
Set
wdApp = CreateObject(
"Word.Application"
)
wdApp.Visible =
True
Set
wdDoc = wdApp.documents.Add
With
wdApp.Selection
.ParagraphFormat.Alignment = wdAlignParagraphCenter
.Font.Size = 16
.TypeText Text:=
CStr
(Range(
"A1"
))
.TypeParagraph
.ParagraphFormat.Alignment = wdAlignParagraphLeft
.Font.Size = 12
.TypeText Text:=
CStr
(Worksheets(
"Tabelle1"
).Range(
"M2"
)) &
" "
.TypeParagraph
If
Worksheets(
"Tabelle1"
).Range(
"L3"
).Value =
"Wahr"
Then
.ParagraphFormat.Alignment = wdAlignParagraphLeft
.TypeText Text:=
CStr
(Worksheets(
"Tabelle1"
).Range(
"M4"
)) &
" "
Else
.TypeText Text:=
" "
End
If
.ParagraphFormat.Alignment = wdAlignParagraphLeft
.TypeText Text:=
CStr
(Worksheets(
"Tabelle1"
).Range(
"N4"
)) &
" "
.TypeText Text:=
CStr
(Worksheets(
"Tabelle1"
).Range(
"M5"
)) &
" "
If
Worksheets(
"Tabelle1"
).Range(
"L5"
).Value =
"Wahr"
Then
.TypeText Text:=
CStr
(Worksheets(
"Tabelle1"
).Range(
"N5"
)) &
" "
Else
.TypeParagraph
End
If
End
With
End
Sub