View Full Version : Command Button to extract data from UserForm
I have a WorkBook in which I have created several userforms, which
thankfully are working well. The userforms contain checkboxes. What I would like to do is create a command button on those forms.
When clicking this button, I would like for the unchecked boxes to be populated onto a word document. Is this
possible to do? Can anyone direct me on getting started?
lucas
02-25-2009, 04:01 PM
What is it you want to put on a word document? The label values of the checkboxes, whether they are checked or not or what exactly?
I would like the label values and whether they are checked or not. Would it help to see the sheet? I will attach. The forms are in L, N, O, P, and Q
lucas
02-26-2009, 12:30 AM
I couldn't get your file to run. You really need to put option explicit at the top of each module.....see attachment, and declare your variable, etc.
See if this gives you an idea of how you might go about it.....see attached.
Thank you Lucas for your help. I am working with the example you provided now. Very Helpful!!!:hi:
Private Sub CommandButton1_Click()
Dim Appword As New Word.Application
There is an error saying "user-defined typed not defined" when I utilize this code in my sheet...Where do I define the object and how? Thanks
lucas
02-26-2009, 08:54 AM
If you had read the comments in the code you would have noticed this line:
'This code requires a referece to the Word object model
Which means that in the vbe you need to go to tools-referenced and put a check next to the
microsoft word 11.0 object library
11.0 may vary depending on which version of Excel you are using. 11.0 is what you would see if you are using Excel 2003. If it is an earlier version it might be 10.0, etc.
I got it!! YEAAA...THANK you THANK YOU:bow:
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.