Hello all,
So far i have the following code to move data from the current worksheet to word:
I have 2 quetions:
1. how do I copy all the data from A1 to E20 from excel to my word file
2. how can i make the filename dynamic. I want it to be the value of A1 + A5 .doc
Thanx in advance!
So far i have the following code to move data from the current worksheet to word:
Code:
Private Sub CommandButton1_Click()
Dim wdApp As Object
Dim wdDoc As Object
Set wdApp = CreateObject("Word.application")
'Set wdDoc = wdApp.Documents.Open _
(Filename:="T:/temp/temp.doc")
'hier met VBA je document vullen
'wdDoc.SaveAs "T:/temp/test1.doc"
wdDoc.Close savechanges:=False
Set wdDoc = Nothing
wdApp.Quit
Set wdApp = Nothing
End Sub
I have 2 quetions:
1. how do I copy all the data from A1 to E20 from excel to my word file
2. how can i make the filename dynamic. I want it to be the value of A1 + A5 .doc
Thanx in advance!