![]() Go back to the main window, select Tools/Macro/Macros./MakeUserForm/Run.Go into the VBE window and check that there is no existing UserForm.Now select File/Close and Return To Microsoft Excel.Tick 'Microsoft Visual Basic for Applications Extensibility 5.3'.Now select Tools/References, scroll down and.Copy and paste the code into the Module.In the VBE window, select Insert/Module.Select Tools/Macro/Visual Basic Editor. ![]() InsertLines X + 5, "Sub CommandButton2_Click()" InsertLines X + 1, "Sub CommandButton1_Click()" '//Add code on the form for the CommandButtons Set NewCommandButton2 = ("forms.CommandButton.1") Set NewCommandButton1 = ("forms.CommandButton.1") ![]() Properties("Caption") = "Here is your user form" Set MyUserForm = ActiveWorkbook.VBProject _ '//First, check the form doesn't already existįor N = 1 To This demonstrates how to go about it.ĭim NewOptionButton As Msforms.OptionButtonĭim NewCommandButton1 As Msforms.CommandButtonĭim NewCommandButton2 As Msforms.CommandButton You may wish to add a userform or userforms to the project only if (say) certain conditions have been met or satisfied. Create a userform with a combo box and the command buttons "OK" and "Cancel" will be created and shown
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |