Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-24-2015, 07:40 AM
spc94 spc94 is offline Executing a userform with a command button Windows 7 64bit Executing a userform with a command button Office 2010 64bit
Novice
Executing a userform with a command button
 
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
 

Tags
command button, macros, userforms



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with a Command Button dkohnken Word VBA 5 03-18-2015 10:13 PM
VBA Code in a UserForm module to delete a Command Button which opens the userform Simoninparis Word VBA 2 09-21-2014 03:50 AM
Command button to show userform suddenly stopped working jpb103 Word VBA 0 05-22-2014 06:05 AM
Word doc bug when closing from userform command button click macro Joe Patrick Word 1 07-05-2011 08:53 PM
Executing a userform with a command button Command Button cksm4 Word VBA 7 02-27-2011 08:47 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:50 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft