extract comments

H

HJC

I have an online survey which puts all of the results into a SS; some of the
survey responses are numbers, which are easy to deal with; some of the
responses are in "essay" form - is there a way to "extract" those comments
either from the whole worksheet or one line at a time and have it go into a
word file?

Many thanks!!
 
H

HJC

I know that I could do that - but am looking for something to automate the
process more - each survey result has 4 or 5 essay responses and there may be
20-30 responses each time I use it.
 
H

HJC

Thank you - that is a good thought; unfortunately the macro works only on
comments that are inserted into a spreadsheet - what I am looking for is
something similar that bring text written into a cell into a word document.
 
D

Dave Peterson

I was confused about the word "comments".

Borrowing heavily from Debra's code:

Option Explicit
Sub CopyValuesToWord()

Dim myRng As Range
Dim myCell As Range
Dim WdApp As Object

Set myRng = Selection 'or whatever range you want...

On Error Resume Next
Set WdApp = GetObject(, "Word.Application")
If Err.Number <> 0 Then
Err.Clear
Set WdApp = CreateObject("Word.Application")
End If

With WdApp
.Visible = True
.Documents.Add DocumentType:=0

For Each myCell In myRng.Cells
.Selection.TypeText myCell.Value
.Selection.TypeParagraph
Next
End With

Set WdApp = Nothing

End Sub
 
H

HJC

WOW - that is fantastic - works like a charm - just what I needed! I truly
appreciate your help with this - I know just enough to be dangerous so am
really happy to have your help!!
 
D

Dave Peterson

Debra did nice work. I only copied and made some minor changes.

But I'm sure she appreciates the thanks.

ps. You may want to bookmark her site. It's full of lots of nice info.
WOW - that is fantastic - works like a charm - just what I needed! I truly
appreciate your help with this - I know just enough to be dangerous so am
really happy to have your help!!
 
Top