Regouin
03-22-2005, 03:37 AM
Hi everyone,
Now I am trying to copy a range of cells from Excel to Word, now this is all not very hard to do and I have accomplished that with a little help from the good old kb, but the problem is that i do not want it to appear in a table form as it does normally. Now I can accomplish that by pasting it as a figure but then my hyperlinks in Excel stop working.
Now I have no experience whatsoever on macro's in Word and I prefer the macro to be based within excel. Here is what I have thus far.
Sub PasteToWord()
Dim AppWord As Word.Application
Dim i As Long
Set AppWord = CreateObject("Word.Application")
AppWord.Visible = True
' Change the range to suit your needs. See the How to Use for this code
With Worksheets("hoofd")
i = 6
Do
i = i + 1
Loop Until .Range("A" & i) = ""
.Range("A6:A" & i).SpecialCells(xlCellTypeVisible).Copy
AppWord.Documents.Add
AppWord.Selection.PasteSpecial Link:=False, DataType:=wdPasteMetafilePicture, _
Placement:=wdFloatOverText, DisplayAsIcon:=False
End With
Application.CutCopyMode = False
Set AppWord = Nothing
End Sub
Now I am trying to copy a range of cells from Excel to Word, now this is all not very hard to do and I have accomplished that with a little help from the good old kb, but the problem is that i do not want it to appear in a table form as it does normally. Now I can accomplish that by pasting it as a figure but then my hyperlinks in Excel stop working.
Now I have no experience whatsoever on macro's in Word and I prefer the macro to be based within excel. Here is what I have thus far.
Sub PasteToWord()
Dim AppWord As Word.Application
Dim i As Long
Set AppWord = CreateObject("Word.Application")
AppWord.Visible = True
' Change the range to suit your needs. See the How to Use for this code
With Worksheets("hoofd")
i = 6
Do
i = i + 1
Loop Until .Range("A" & i) = ""
.Range("A6:A" & i).SpecialCells(xlCellTypeVisible).Copy
AppWord.Documents.Add
AppWord.Selection.PasteSpecial Link:=False, DataType:=wdPasteMetafilePicture, _
Placement:=wdFloatOverText, DisplayAsIcon:=False
End With
Application.CutCopyMode = False
Set AppWord = Nothing
End Sub