userform

Process a combobox called from another userform

核能气质少年 提交于 2020-01-06 08:07:58
问题 I have a userform that contains a combobox where I can search through. If I recall this userform directly, the combobox works fine. If I instead start from another userform and press a button to open the userform with my combobox , the search won't work. I tried with "_Change". This is the applicable part of the first userform: If InStr(I1.Text, " ") > 0 Then New_Pat.First.Text = Left(I1.Text, Len(I1.Text) - 1 - (Len(I1.Text) - InStr(I1.Text, " "))) New_Pat.Second.Text = Right(I1.Text, Len(I1

Process a combobox called from another userform

↘锁芯ラ 提交于 2020-01-06 08:07:07
问题 I have a userform that contains a combobox where I can search through. If I recall this userform directly, the combobox works fine. If I instead start from another userform and press a button to open the userform with my combobox , the search won't work. I tried with "_Change". This is the applicable part of the first userform: If InStr(I1.Text, " ") > 0 Then New_Pat.First.Text = Left(I1.Text, Len(I1.Text) - 1 - (Len(I1.Text) - InStr(I1.Text, " "))) New_Pat.Second.Text = Right(I1.Text, Len(I1

Class Module codes for Change Event of comboboxes

℡╲_俬逩灬. 提交于 2020-01-06 07:26:10
问题 I have a userform where I put 10 rows of comboboxes for 7 columns. Which means I got 70 comboboxes altogether. To ease your understanding, I will refer the first combobox as (1,1) for (row,column). What am I trying to do is, when a user input values on any combobox on Row 1, I want the values to be copied on its adjacent combobox at Row 2. For example, if I select value on (1,3), same value will appear on (2,3). The same thing goes to Row 3 & 4, Row 5 & 6, and so on. This is the code on my

Access controls of a frame passed by reference in a sub

牧云@^-^@ 提交于 2020-01-06 05:40:27
问题 I am trying to pass many MSForms.Frames of a UserForm to a sub that is supposed to do stuff with the textboxes they contain: initFrame(frame1) However, once passed, I cannot access the .Controls property of that frame anymore (added a watch during debug, all that's left are Items). I have tried many different sub declarations, but they either don't compile or lose the properties... Private Sub initFrame(ByRef currFrame As MSForms.Frame) Private Sub initFrame(ByRef currFrame As MSForms.Object)

How to make userform in Excel VBA remember password when 'red x' is pressed

喜欢而已 提交于 2020-01-05 23:30:53
问题 I have a userform that calls a function with username/password prompt. The user usually has to run it more times and each time is prompted for the login credentials so I want the userform to remember the user/password once it has been given until the workbook has been closed. It is working fine until the user presses the 'process' button or closes the userform from the 'close' button, but when he/she closes it with the 'red x', the user/pass disappears on the next run. I know that the 'red x'

Show current time (EST)

天涯浪子 提交于 2020-01-05 03:55:13
问题 I created a UserForm that contains a textbox that will show the current time in EST. The only problem is, the time that's reflecting is of course the current time in our country so I want to convert it in EST, which is - 12:00 from our time. Private Sub UserForm_Initialize() If ActiveWorkbook.MultiUserEditing Then End If Application.ScreenUpdating = False Application.DisplayAlerts = False txtDate.Value = Format(Now, "mm/dd/yyyy") Application.ScreenUpdating = True Application.DisplayAlerts =

Filling Excel userform in excel file automatically from vbscript

和自甴很熟 提交于 2020-01-04 04:29:48
问题 I have an Excel file that is full of macro and functions and userforms that help the user to fill the data correctly in this Excel file. I need to write a VBScript that accesses one of the userforms. Fills it automatically. I know how to call a VBA macro that does exist in a workbook. objExcel.Application.Run"'CAM0500040F10_SW_Quality_Assurance_Report_Template (05-11-2012).xlsm'!new_document()" but now I need to be able to fill a userform from my code. is there a way to do that? 回答1: One way

How to find lost userform control

喜夏-厌秋 提交于 2020-01-03 03:29:06
问题 I have a userform with a bunch of frames. I accidentally dropped a checkbox into one of those frames and it is now nowhere to be found. It still exists, because I'm able to set the value of it with the code, but I can't see it. I tried expanding the frame and also moving the things in the frame (in case it went behind one of those controls). How can I pull it back out? 回答1: This will tell you the position of the checkbox within the frame: Private Sub UserForm_Initialize() Debug.Print Me

UserForm error: Method 'Properties' of object '_VBComponent' failed

本秂侑毒 提交于 2020-01-02 04:31:13
问题 I want to edit my UserForm object in VBE with code. When I use the following, I get an error as in post title: Sub myTest() ThisWorkbook.VBProject.VBComponents("UserForm1").Properties("Caption") = "myCaption" End Sub I tried changing "Caption" to "caption", the same error. Also this error happens when I try to set Width or Height properties, not always at first time, but when I run the code again to resize. Edit 1: "Trust access to the VBA project object model" in macro settings is enabled.

Remove the scroll bar on a list box

久未见 提交于 2020-01-01 05:02:54
问题 I'm using a userForm in vba and I have a list box. I want to remove the horoz. scroll bar from the bottom. Is there a way to do this? I don't see any option in the properties box. 回答1: This can occur when you have the column width format property of the listbox set to something wide, then you size the control to the data, it will show the scroll bars. To fix this, change the "Column Width" property under the format tab to something really small, then play around with this property and the