userform

Display Excel Workbook on a Userform

为君一笑 提交于 2021-02-18 11:09:37
问题 Objective : As the title suggest, how do we display the workbook on the userform without using any third party controls. By Display , I mean show it on a userform where a user can select a worksheet and view the contents of that worksheet. This post is an attempt to self answer the question. 回答1: The method that I am going to demonstrate below will not use any Third Party Control. In fact it will display the worksheet in an image control. This obviously means that you cannot interact with the

Display Excel Workbook on a Userform

南楼画角 提交于 2021-02-18 11:07:24
问题 Objective : As the title suggest, how do we display the workbook on the userform without using any third party controls. By Display , I mean show it on a userform where a user can select a worksheet and view the contents of that worksheet. This post is an attempt to self answer the question. 回答1: The method that I am going to demonstrate below will not use any Third Party Control. In fact it will display the worksheet in an image control. This obviously means that you cannot interact with the

Redraw a UserForm in VBA

…衆ロ難τιáo~ 提交于 2021-02-11 17:25:49
问题 I have a userform in VBA and I'd like to redraw/update it in the middle of a method. When the method is called on button click, the function is as below: UsrForm.Field1.Value = "" UsrForm.Field2.Value = "" UsrForm.Label1.Caption = "LOADING..." /*Processing occurs*/ UsrForm.Field1.Value = val1 UsrForm.Field2.Value = val2 UsrForm.Label1.Caption = "DONE" However, the update to the form visible only occurs when the method is completed. I get val1, val2, and "DONE" but not the "LOADING..." message

Stop in Close and Open userforms _VBA

六月ゝ 毕业季﹏ 提交于 2021-02-10 16:51:40
问题 I created two forms. Pressing the button 1 opens the form number 2. By closing the form number 2, the form number 1 is displayed. But this action is only done once and it stops for the second time and almost does not work. Where does the code have a problem? code Userform1: Private Sub ShowUserform2_Click() UserForm1.Hide Unload UserForm1 UserForm2.Show End Sub Code userform2: Private Sub UserForm_Terminate() UserForm2.Hide Unload UserForm2 UserForm1.Show End Sub 回答1: Skip the formName.Hide

Stop in Close and Open userforms _VBA

纵饮孤独 提交于 2021-02-10 16:48:52
问题 I created two forms. Pressing the button 1 opens the form number 2. By closing the form number 2, the form number 1 is displayed. But this action is only done once and it stops for the second time and almost does not work. Where does the code have a problem? code Userform1: Private Sub ShowUserform2_Click() UserForm1.Hide Unload UserForm1 UserForm2.Show End Sub Code userform2: Private Sub UserForm_Terminate() UserForm2.Hide Unload UserForm2 UserForm1.Show End Sub 回答1: Skip the formName.Hide

ListBox Form Control Scrolling

久未见 提交于 2021-02-08 09:36:05
问题 I've been doing a ton of research and I'm finally giving in and hoping the community can help. I have a FORM CONTROL list box, not an active x. I'm intentionally using form control for a variety of reasons that are not necessarily important (unless you can guide me how to 100% ensure activeX controls don't resize themselves on workbook open). I cannot, for the life of me, figure out how to get the form control list box to scroll to the selected value and put it in view. Here is what I have:

Search via textbox to auto-update listbox entries

隐身守侯 提交于 2021-02-08 08:52:07
问题 I would like to implement a search function in a listbox in a userform getting a better view of the many columns and unfortunately I can't find a solution. The optimal solution would be, if I could search in a textbox for any row content (up to 12 columns containing data like e.g. name, ID, position, organization, ...) and the listbox would automatically update itself showing all matching entries. In UserForm_Initialize I filled the listbox as follows: Private Sub UserForm_Initialize() With

AddItem not populating options in combo box

▼魔方 西西 提交于 2021-02-04 21:42:04
问题 I have the following form. I've added each item as per .AddItem "" , however they are not populating in the combobox in the userform. (This is in a separate module referring to the userform) Code With frmForm .txtFirst.Value = "" .txtLast.Value = "" .txtYear.Value = "" .cmbSchool.Clear .cmbSchool.AddItem "Harvard" .cmbSchool.AddItem "Northwestern" .cmbSchool.AddItem "UCBerkley" .cmbSchool.AddItem "Stanford" .cmbSchool.AddItem "NYU" .cmbSchool.AddItem "UoT" .cmbSchool.AddItem "UBC" .cmbSchool

AddItem not populating options in combo box

孤街浪徒 提交于 2021-02-04 21:37:21
问题 I have the following form. I've added each item as per .AddItem "" , however they are not populating in the combobox in the userform. (This is in a separate module referring to the userform) Code With frmForm .txtFirst.Value = "" .txtLast.Value = "" .txtYear.Value = "" .cmbSchool.Clear .cmbSchool.AddItem "Harvard" .cmbSchool.AddItem "Northwestern" .cmbSchool.AddItem "UCBerkley" .cmbSchool.AddItem "Stanford" .cmbSchool.AddItem "NYU" .cmbSchool.AddItem "UoT" .cmbSchool.AddItem "UBC" .cmbSchool

ThisWorkbook Workbook_Open fails to show userform if Excel or Word already open

社会主义新天地 提交于 2021-02-04 06:24:59
问题 I use Office365. I have an Excel file called Test.xlsm which contains a userform named frmMain. In the ThisWorkbook object and then in the Workbook_Open event I have the following code: Private Sub Workbook_Open() Worksheets("Main").Activate frmMain.Show End Sub It is meant to launch (show) the frmMain userform every time the Test.xlsm file opens. However, if another Excel or Word file is already open, the frmMain user form fails to launch/show. Is there a way to have an Excel or Word file