Populating Excel Worksheet with data from Word VBA UserForm

Z

Zoltar54

I am trying to find a method to populate an excell sheet with information
that is entered into a Word userform that I have created. I am quite new to
VBA and have had great difficulty in finding a solution. Can someone please
point me towards the light!
 
T

Tony Jollans

Word UserForm, Excel UserForm, they're both the same.

If you have to run from Word, you'll need to use Automation to talk to
Excel, something like ..

Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlapp.Workbooks.Add
Set xlSheet = xlwb.Sheets(1)

You can then reference individual cells like this ...

xlSheet.Cells(_row_, _column_)

And, when you're done ...

xlBook.SaveAs ...
xlBook.Close
xlApp.Quit

If you want more detail, I suggest you ask in an Excel newsgroup - and
provide details about what is on your yserform and how you want it arranged
in a worksheet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top