View Single Post
 
Old 06-24-2015, 07:40 AM
spc94 spc94 is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Jun 2015
Location: Ohio, USA
Posts: 8
spc94 is on a distinguished road
Default Executing a userform with a command button

I have created a user form that has multiple check boxes. I want to be able to execute the check boxes selected by clicking a command button that will close the user form. Here is the code I have for the check boxes which I tested an works.

Sub CheckBox1_Click()
Unload Me
ChangeFileOpenDirectory _"X:\sconner\CCD Damage Mechanisms\Data Transfer Practice\"
Documents.Open FileName:= _
"X:\sconner\CCD Damage Mechanisms\Data Transfer Practice\Mechanism Transfer Practice.docx" _
, ConfirmConversions:=False, ReadOnly:=False, AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _
wdOpenFormatAuto, XMLTransform:=""
Selection.WholeStory
Selection.Copy
ActiveWindow.Close
Selection.PasteAndFormat (wdFormatOriginalFormatting)
End Sub
Reply With Quote