sakura.saki
Board Regular
- Joined
- Apr 12, 2012
- Messages
- 112
Hi guys,
I am now having this problem and I searched in the internet, but didn't find what I am looking for. my job is to pull the data from an sheet into a word document. I have to import the value of some cells as normal text instead of the entire table as a form because instead of short words and numbers, some of the cells are filled with long sentences.
I have create a button on the sheet, so far I could only import the entire table into a new word, but I can´t import particular cell values into it.
so does anyone know how? maybe a piece of code, with which I could begin ?
thanks a lot!
P.S: there is something I tried to use, but didn´'t work:
Set wordapp = CreateObject("Word.Application")
'Add new Word Document
With wordapp
'.ScreenUpdating = False
.Visible = True
.Activate
End With
With wordapp.Selection
Set wordDoc = wordapp.Documents.Add
'save and close the Word document
Sheets("all teams together").Range("A2").Value.Copy
With wordDoc
.Content.PasteSpecial Link:=False, DataType:=wdPasteText, Placement:= _
wdInLine, DisplayAsIcon:=False
End With
......
the line in red is marked in yellow and there is a error message:Object required
I am now having this problem and I searched in the internet, but didn't find what I am looking for. my job is to pull the data from an sheet into a word document. I have to import the value of some cells as normal text instead of the entire table as a form because instead of short words and numbers, some of the cells are filled with long sentences.
I have create a button on the sheet, so far I could only import the entire table into a new word, but I can´t import particular cell values into it.
so does anyone know how? maybe a piece of code, with which I could begin ?
thanks a lot!
P.S: there is something I tried to use, but didn´'t work:
Set wordapp = CreateObject("Word.Application")
'Add new Word Document
With wordapp
'.ScreenUpdating = False
.Visible = True
.Activate
End With
With wordapp.Selection
Set wordDoc = wordapp.Documents.Add
'save and close the Word document
Sheets("all teams together").Range("A2").Value.Copy
With wordDoc
.Content.PasteSpecial Link:=False, DataType:=wdPasteText, Placement:= _
wdInLine, DisplayAsIcon:=False
End With
......
the line in red is marked in yellow and there is a error message:Object required
Last edited: