userform

Can't close userform

对着背影说爱祢 提交于 2019-12-11 12:22:49
问题 Let me set up the environment. This is VBA code running in Excel. I have a userform that contains a msflexgrid. This flexgrid shows a list of customers and the customer', salesperson, csr, mfg rep, and territories, assignments. When you click in a column, let's say under the Territory column, another userform opens to show a list of Territories. You then click on the territory of your choice, the userform disappears and the new territory takes the place of the old territory. This all works

Userform listbox rowsource not populating

99封情书 提交于 2019-12-11 12:19:19
问题 I have a userform with an OK and Cancel button and a listbox. It is supposed to populate using this code: Private Sub UserForm_Initialize() Me.StartUpPosition = 0 Me.Top = Application.Top + (Application.Height / 2) - (Me.Height / 2) Me.Left = Application.Left + (Application.Width / 2) - (Me.Width / 2) With Me.ListBox1 .RowSource = "" .ColumnCount = 7 .ColumnWidths = "80;100;20;1;20;1;1000" .RowSource = Sheets("BOH Database").Range("H9:N14").Address ' .RowSource = Sheets("BOH Database").Range(

How to prevent F5 key from saving data from userform in access

淺唱寂寞╮ 提交于 2019-12-11 11:52:25
问题 I have a bound form in MS Access and I use a submit button to insert the data from form to table. I have around 10 fields in form and even if I fill only 1 field and press the F5 button, it saves the data with just one field. How to stop F5 key from doing this. Edit - also when I close the form with partially filled data or if it gets closed accidently or when if i open design mode from there, it collects that partially filled data and then creates an entry, how to stop userform making

Adding a scroll bar to a label

只愿长相守 提交于 2019-12-11 11:01:27
问题 I have a label on a userForm and the data within it is in list form. The data is longer than the label. Without expanding the label, is there a way to add a scroll bar to it? Or is there another option? Basically I want a box that does not have a scroll bar unless the list is longer than the box, then there's a scroll bar. Using Excel vba userForm 回答1: You can used a textbox styled to look like a label. Set it to multiline with scrollbars set to vertical. Scrollbars will only show up if the

Excel UserForm displays at the wrong size

自古美人都是妖i 提交于 2019-12-11 10:19:06
问题 I'm having a very strange issue with Excel UserForms; when I display a form by clicking a command button in my worksheet, the size of the form warps significantly, making it essentially unusable. The below images illustrate this. Form before size warping (intended size) Form after size warping I work with a multiple screen setup, and this sizing issue only occurred at first when just using my laptop without the additional displays; however, it has now started occurring even with my usual

How to fix this bug in my code that doesn't allow me to update other columns in excel userform?

和自甴很熟 提交于 2019-12-11 08:57:23
问题 Hello I've been working on this excel userform for a month now and I'm almost done. But there's a bug in my code that doesn't show any errors but it won't let me update the rest of the columns. When I click on the "View List" button, the data in the spreadsheet will be displayed in the ListBox. And if I click on a value, say I click "dfldasfjasldk", its row values will be displayed on the ComboBoxes, allowing the user to edit the information. Image : And when I click on the "Update Row" the

deactivate Excel VBA userform

狂风中的少年 提交于 2019-12-11 07:18:55
问题 I am having some macro in Excel vba and in that I am performing some functions on the excel sheets which takes around 30 seconds to complete. So I want to show a user form with a progress bar during that span of time. I tried using userform.show in very start of the function and userform.hide at the end but I found that No action can be performed in background. So just want to know if there is any turn around to let the processing be done in the background while the form is being displayed.

VBA- Check if a particular userform is Loaded or not

给你一囗甜甜゛ 提交于 2019-12-11 06:38:15
问题 I want to check if a userform is loaded or not while running a code. I tried several ways, no-one is working. I remember I did that before, but I can't recall my workaround. Any idea? I found some solutions here and other places, they also was not working! The issues are … vba.userforms just accepts index numbers, not string indexes, on a loop over the userforms some properties like name is not accessible to check! Here are my Tries: Public Function IsFormVisible(FrmName As String) As Boolean

VBA How to display UserForm right under the cell?

吃可爱长大的小学妹 提交于 2019-12-11 06:22:45
问题 I want to display UserForm right under the button that is placed in cell so it can simulate some popup window (just like dropdown list). I tried many solutions over the net and none of them worked. The main problem is I'm not able to get the absolute screen location of cell or button on sheet. 回答1: You would use something of this logic: Sub SO() With UserForm1 .StartUpPosition = 0 .Top = Application.Top + (ActiveSheet.Shapes(Application.Caller).Top + 170) .Left = Application.Left +

Excel-VBA MultiPage: move/reorder/index pages at runtime?

牧云@^-^@ 提交于 2019-12-11 06:07:57
问题 I'm working on a little Excel-VBA GUI/Form for the user to read and write data from/to an .ini file. The UserForm has a MultiPage in which the user creates pages at runtime and each page will represent an ini section. Furthermore, these sections are also indexed in a master section for further processing: at this point I'm looping through the MultiPage pages to create this index. Problem is, the user needs to be able to change the order of this index. Now, is it possible to move the pages