JamesDekker
08-18-2010, 07:22 PM
Hi Folks,
This is my first post here and I hope you can help me. I am working on a project in excel 2003 to copy data from an excel spreadsheet to a existing word template userform.
The spreadsheet is a calculator that is used to calculate an account balance and the template is a letter that is sent to the customer with the account balance information on it. The calculator is only numbers and dates and the template is all the customer info (name, address ect.).
As the word template already exists and is in use I want to programme my excel calculator to copy the data that is entered and calculated in the spreadsheet to the word template userform.
I am new to VBA and I have got as far as opening the template from the calculator........
------------------------------------------------------------------
Sub LaunchWrdTemplate()
Dim WrdApp As Object
Dim WrdDoc As Object
Set WrdApp = CreateObject("Word.Application")
WrdApp.Visible = True
Set WrdDoc = WrdApp.Documents.Add("Filepath\Word.dot")
End Sub
------------------------------------------------------------------
I now need to take the data from the spreadsheet and populate the word userform. Is there anyway to simply copy a cell contents from the spreadsheet to a specified field in a word userform using VBA in excel??
I have tried a few ways and I am going a bit crazy (:banghead: like this guy) so it be great if someone could help me out. Thanks.
This is my first post here and I hope you can help me. I am working on a project in excel 2003 to copy data from an excel spreadsheet to a existing word template userform.
The spreadsheet is a calculator that is used to calculate an account balance and the template is a letter that is sent to the customer with the account balance information on it. The calculator is only numbers and dates and the template is all the customer info (name, address ect.).
As the word template already exists and is in use I want to programme my excel calculator to copy the data that is entered and calculated in the spreadsheet to the word template userform.
I am new to VBA and I have got as far as opening the template from the calculator........
------------------------------------------------------------------
Sub LaunchWrdTemplate()
Dim WrdApp As Object
Dim WrdDoc As Object
Set WrdApp = CreateObject("Word.Application")
WrdApp.Visible = True
Set WrdDoc = WrdApp.Documents.Add("Filepath\Word.dot")
End Sub
------------------------------------------------------------------
I now need to take the data from the spreadsheet and populate the word userform. Is there anyway to simply copy a cell contents from the spreadsheet to a specified field in a word userform using VBA in excel??
I have tried a few ways and I am going a bit crazy (:banghead: like this guy) so it be great if someone could help me out. Thanks.