I've a worksheet, which has formulas, links, combo list box and format control.
I've made a user form to enter the data, so that the particular cells in the worksheet is filled and the remaining cells are calculated as per the formula.The format control (combo box) has list of range.
Is it possible to bring this format control (combo box) on the user form, so that without going to the sheet, I Can control the sheet by selecting the combo box values.
This is weird - if you delete a sheet that contained a control then
a. showing a modeless userform resluts in a userofrm that goes invisible at subroutine End b. public variables lose their value
These things do not happen if the sheet did not contain a control. Attached is an example file - put the inputfile.xls in your default file location (or add a path in the code) then open the ProblemDemo.xls and run the main macro to see it fal - isthis another Excelbug I've found?
I Have a sheet with 4 activex comboboxes and 3 text boxes. If the right item is selected in the second combo box a user form opens up. That has 4 text boxes. It has a command button titled ok that takes the information from the 4 text boxes and puts them in a sheet called data.
Code: Private Sub cmbOK_Click() With Worksheets("Data").Range("A1") .Offset(1, 8).Value = Me.txtFirm.Value
I need a way for the above code to run when the ok button on the user form is clicked.
I have several non-modal userforms in my App, some of them have date-fields that require manual entry typing of dd/mm/yy etc (No single userform has more than one date-box in it, this I think may be pivotally useful)
Now the Userform 'Calendar' that is built on the class of the same (cCalendar) name, has the write value line 'ActiveCell.value = theCal.value'
I'm looking to change this to refer to the correct userform.Textbox value, depending on which form is open.
I would imagine I could simply have a global string, whose value is set (or re-set) whenever a Userform is initialized (some sort of 'ActiveUF.value = Me.Name), where I get lost is referring to the components by name, so as to have a case statement by where I go:
Private Sub theCal_AfterUpdate() Select Case ActiveUF Case "AddForm" application.vbe.components("AddForm").controls("AddFormDatePicker").value = theCal.value Case "EditForm" '.... etc end select end sub
better way of doing this (instead of passing around the userform name as a variable) - or proper syntax for referring to controls outside of the 'active' userform (but an open userform nonetheless)?
Every time I have to do this particular thing with userforms, I completely forget how, and the object browser always leads me on an infinite loop of Application.vbe.activevbproject.vbcomponents.vbe.active....
PS - there may be one slight complication to the process - one of the forms, has a 2-tab page in it, each page having similar (but named differently) fields. So I may need to be able to throw in 'Activepage' or whatnot
I've got the bare bones of a toolbox control on my userform but I can seem to find anyway to refer to the buttons and control them (I’ve tried using the properties page but it doesn't seem to give me the options I need). I want to be able to add a macro and a picture to the buttons, is this possible?
.image/picture/faceid = “x” .action = "macro1"
I've looked for ages on the board but can only find threads on creating toolbars in the application, not on userforms.
Split off from Loop Through ActiveX TextBox Controls On Worksheet. Here is a zip file with the files in it. The main one that I am working on now is PO Form.xls. I want to start with the Qty column and copy any values that are entered into the form to the file called PO.xls in the Qty column of this file.
This code works fine on a normal userform But I declared the userform with "New" in my calling procedure
myForm As New form
How can I get it to work?? Or more interesting, why is it not working Also what exactly is the advantage of using the keyword New I have propertys set in the userform, but other than that.. Can someone tell me if the load function in this case is better or not
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub cmd_click Call blink End Sub
Public Sub Blink() Dim i As Long For i = 1 To 20
' set color Form.cmd.BackColor = &HFFFFFF DoEvents Call Sleep(60)
I have a project with many textboxes on different forms. On some of the textbox_exits on some of the forms, I call a standard module that checks what the user has input. If the user needs to change the input, a msgbox appears to inform the user the info needs to be changed.
I have tried to use ControlSource, Name etc., But I cannot seem to setfocus back onto which ever textbox the input needs to be changed. I think it has something to do wih the _exit event, but not sure.
I am trying to implement a simple userform using the RefEdit control.
So I have the RefEdit control and an Ok (which has code attached to it) and a Cancel commandbutton.
For some reason, I can't get the focus on the RefEdit control (i.e. when I activate the form, I have to actually click in the RefEdit box before it gets the cursor). Which property sets the focus in this control?
Right now I have the Ok button Default property set to True.
I have a commandbutton on the spreadsheet that activates the userform.
Suppose I have a userform named myUserForm and a checkbox on it named myCheckBox. How on earth do I remove myCheckBox from myUserForm at run time? I've tried every which way I can think and I always get "error 444". Some things I've tried are:
can i disable/remove a control from the being in the tab order. i no i can move to the bottom but there is too many too use that option. i need it to be elimated from user input alltogether. it is filled automatically
I have a workbook which when opened connects to an external datasource (excel file) and downloads a table of information. While this is happening I have a userform which shows which has a lable saying (connecting to datasource, please wait....). However, when I open the workbook, the userform shows but the labels do not show, the userform just appears white.
i've gotta demo an Excel app in a few days and this never really bothered me, but someone recently pointed out that it can get distracting for the Control Toolbox to pop in and out randomly. the form is being built for use by other staff, and i suppose it would also be distracting for them if the toolbox arbitrarily appeared here and there. is there a way to turn it off?
I have a User Form that is used to collect data. CommandButton1 loads the User Form data into the worksheet and CommandButton2 clears all data from the Form in preparation for entering the next record. Immediately after a user first opens the Form, the very first time CommandButton1 is clicked, the Enter Key stops working. At this point data can be typed into any TextBox on the Form, but when the Enter Key is pressed the cursor remains in the TextBox. (The Enter Key will not move the focus to the next Textbox in the Tab Order. Also, if I alter the code to set the focus on a CommandButton as the active control instead of a TextBox, pressing Enter on the active CommandButton does not execute the CommandButton's macro... the same behavior as a TextBox; nothing at all happens when the Enter Key is pressed even though the CommandButton has focus).
At the point when the Enter Key stops functioning, if the user presses 'Alt-Tab' to leave the Form and then immediately uses 'Alt-Tab' to return back into the Form the Enter Key suddenly works again and continues to work correctly from that point on even after CommandButton1 is clicked. Again, the Enter Key stops working ONLY the first time CommandButton1 is run immediately following initially opening the workbook and Alt-Tabing into the Form immediately corrects it. I saw one other post in this forum with this same problem in 2003, but unfortunately it did not get answered.
If this control is a TextBox, I would like to read the Text property, and if it's a ComboBox, I would like to read the Value property.
Public Function readValue(c As Control) As String If (TypeName(c) = "TextBox") Then ' convert the Control to TextBox then put readValue = c.Text Else If (TypeName(c) = "ComboBox") Then 'convert the Control to ComboBox then put readValue = c.Value End If End If End Function
My difficulty: I have an Excel 2007 DB xlsx Workbook file (mydb.xlsx) made up of several (8) Worksheets. I can't modify the content of this DB. For this reason I 've created another Workbook (MyGUI.xlsm) implementing a user interface for db querying.
The userform let the user making searches using the find method (criteria: "Text contains...") In the DB file there is one particular Sheet with thousands of entries. This makes the searchs too long (30 seconds). During this period the entire form is blocked.
My question: when the user realizes the search is too long I'd like to stop the current search introducing for example a new button "stop current Search" to click it in these situations.
I have built a quoting tool and Userforms to act as a user interface to this tool. The userforms basically just feed user input back to relevant sheets. I have a number of textboxes, listboxes and radio buttons on multipages. Now the issue is that each control has an Afterupdate or Change event associated with it. Consider this scenario:
I have 4 product categories (represented by radio buttons) : Cat A, Cat B, Cat C, Cat D
Each category can have up to 10 line items which are represented by combo boxes.
Now lets say the user has selected Cat A radio button, he selects a product from the combo box (the cursor or focus is still on the combo box) and clicks on Cat B radio button. Here is the issue: on the first click, Afterupdate or Change event of Combo box fires but radio button is still unselected. The user has to click Cat B radio button AGAIN to select Cat B radio button. So essentially it takes two clicks with a slight pause between them to change categories.
One way to avoid this is to press Enter or 'tab through' each field. But this is not very intuitive. I have tried using Exit, Afterupdate, Exit, Change events without success. I can't use ControlSource option because the cell to input info to is dynamically selected. I have used xlCalculationManual for some text boxes but can't use this since some inputs on the userforms depend on the right value being calculated on the sheet.
Is there a way to call a subroutine anytime any control is changed within a userform?
I have a userform that needs to go through and add/multiply almost every value in every textbox and also add together values associated with checkboxs. I need this to happen anytime a textbox value is changed or a checkbox is checked.
creating 2 fields in my userform that the user can input 2 dates that would serve as the range to set the autofilter. So user inputs field1 = 11/01/2011 and then field2 = 01/31/2012.
I was previously using a month range in my userform, populating from the known months and allowing the user to select a range. Since our data is now spanning a new year, this is no longer possible as I cannot make the combobox range go from 11 - 1 (November to January)
VBA Userform - select months & Months between - Code Included