T
TT
Hello,
I'm trying to copy cells from Excel to Word. This in itself works just fine.
But, I'm having problems in changing font size in different paragraphs. The
settings I apply to the first paragraph apply to all - no matter what.
Here's the code:
------------
Sub TW()
Dim AppWD As Word.Application
Dim DocWD As Word.Document
Dim RangeWD As Word.Range
Set AppWD = CreateObject("Word.Application.11")
AppWD.Visible = True
Set DocWD = AppWD.Documents.Add
With DocWD
Set RangeWD = .Range
Sheets("T").Select
Range("A1:F1").Select
Selection.Copy
With RangeWD
.Font.Name = "Arial"
.Font.Size = 12
.Font.Bold = True
.PasteSpecial DataType:=wdPasteText
'DataType:=wdPasteText, Placement:=wdInLine
End With
Sheets("T").Select
Range("A2:A6").Select
Selection.Copy
With RangeWD
.Font.Name = "Arial"
.Font.Size = 12
.Font.Bold = False
.PasteSpecial DataType:=wdPasteText
End With
End With
End Sub
----------------------
The problem is that font.name, font.size, font.bold I've given to range
A1:F1 applies to A2:A6 as well. How can I get this done? Any ideas?
TIA,
TT
I'm trying to copy cells from Excel to Word. This in itself works just fine.
But, I'm having problems in changing font size in different paragraphs. The
settings I apply to the first paragraph apply to all - no matter what.
Here's the code:
------------
Sub TW()
Dim AppWD As Word.Application
Dim DocWD As Word.Document
Dim RangeWD As Word.Range
Set AppWD = CreateObject("Word.Application.11")
AppWD.Visible = True
Set DocWD = AppWD.Documents.Add
With DocWD
Set RangeWD = .Range
Sheets("T").Select
Range("A1:F1").Select
Selection.Copy
With RangeWD
.Font.Name = "Arial"
.Font.Size = 12
.Font.Bold = True
.PasteSpecial DataType:=wdPasteText
'DataType:=wdPasteText, Placement:=wdInLine
End With
Sheets("T").Select
Range("A2:A6").Select
Selection.Copy
With RangeWD
.Font.Name = "Arial"
.Font.Size = 12
.Font.Bold = False
.PasteSpecial DataType:=wdPasteText
End With
End With
End Sub
----------------------
The problem is that font.name, font.size, font.bold I've given to range
A1:F1 applies to A2:A6 as well. How can I get this done? Any ideas?
TIA,
TT