-
How To Set Up Cascading Combo Boxes On An Excel VBA Userform
Hi everyone, in the previous post How To Make A Basic Excel VBA UserForm Search Box I showed how to create a search form based on three columns, but the issue with it was that it shows all the items in the column, and doesn’t filter the data based on the previous selection. In this…
-
How To Run A Macro When Cell Value Changes In Excel VBA
Sometimes you want to be able to monitor a range of cells in your worksheet for any changes. Using this, you can run a macro when a cell changes to a specific value. Here I will show how to run a macro when a cell value changes in Excel VBA This post will also answer…
-
What is for each loop in VBA?
What is for each loop in VBA? A for each loop in VBA is a way of interating through a range of cells in your worksheet. For instance, below is my data, I need to place in a column. Here I am adding a button called “Put In Column” You will need to assign the…
-
What is a Select Case statement in VBA?
A Select Case in VBA is a conditional check function. In my opinion, it is a bit easier to read than the If statement. It controls program flow based on the condition of a variable In the following example I am using the Select Case to evaluate the price of a certain security. The “PriceDecision”…
-
How do you write if then statements in Excel?
In our example, orders over $15 qualify for free shipping. Here we want to calculate if the order qualifies for free shipping so we can filter and identify them. We are going to create a user defined, custom function and pass the price as the only argument, and return the result of “True” or “False”…
-
How do you use ListBox in Excel?
What is ListBox control? The list box allows you to see multiple items in one view and allows the user to select one or multiple items in the list. It helps you to manage a big worksheet, and allows you to put constraints on your data lists. You can design it with the ability to…
-
How do I automatically open a UserForm in Excel?
In order to open a UserForm automatically, you will need to use the “open” event of the Excel workbook. Here is the code to add to the “ThisWorkbook” object’s Open event: Private Sub Workbook_Open() UserForm1.Show End Sub After you save and close the workbook, and then reopen it, the UserForm will automatically appear. PS. Make…
-
What is the difference between ComboBox and ListBox?
The question here is “what is the difference between combobox and listbox?” Basically with a combobox you see one selected item at a time, and with a listbox you can see multiple items, and multiple selected items. Consider the following 2 examples, where you have a userform with 2 controls displaying the same data listed…
-
What is a UserForm in VBA?
A UserForm is a tool for entering data into your worksheet in a controlled manner. You can control what cells the user enters the data in, and the type of data that gets entered into the cells. You can also validate the data entered on the form before it actually gets entered into the worksheet.…
-
What is a VBA function?
A VBA function a function like one that is already in Excel (sum, average, count etc.) which allows you to extend the functionality of Excel. A function returns a value. So basically you can create your own “sum” function: Function MySum(arg1, arg2) As Double Dim dblTemp As Double dblTemp = arg1 + arg2 MySum =…