View Single Post
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

z is just a variable that the cell values are being concatenated into.

Sub moveToWord()
Set x = CreateObject("Word.Application")
x.Documents.Add
x.Visible = True

For Each cl In Range("A1:H10")

z = z & cstr(cl.value)

Next
x.Selection.TypeText CStr(z)

End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Adam" wrote in message
...
I have had great help with Galimi for this process (as I am still learning
VBA). I do not quite understand this code:

Sub moveToWord()
Set x = CreateObject("Word.Application")
x.Documents.Add
x.Visible = True

For Each cl In Selection

z = z & cstr(cl.value)

Next
x.Selection.TypeText CStr(z)

End Sub


What does the Z represent? Also, I need to not select everything in the
worksheet, I just need to get portion of the data. So it is not every

cell.
How do I pre-define a selection?/

Thanks