Run a Macro at a Specific Time

Sub ImportModules() Debug.Print "test" End Sub Private Sub Workbook_Open() Application.OnTime Now + TimeValue("00:00:01"), "domeprog.ThisWorkbook.ImportModules" End Sub The code above will run the macro called 'ImportModules' one second after the workbook is opened. If the macro is located in a class module or in ThisWorkbook class, then you will need to call out the library + … Continue reading Run a Macro at a Specific Time

Add items to a UserForm ComboBox

When you don' t want the user to input their own value, set the combobox style to 2. This will force the user to pick from the list of items. The default style is 0, it will behaves as a drop-down combo box or a region to type any value. ComboBox54NozzleSize.sytle = 2 '0=fmStyleDropDownCombo '2=fmStyleDropDownList … Continue reading Add items to a UserForm ComboBox

Clear All Check Boxes In Excel VBA Userform

This example uses a for each loop so that each check box name does not have to be explicitly written out. This is useful when you are adding more control and limit the amount of code you are writing. Better Method Dim ctrl As Control Sub ClearAllButton_Click() For Each ctrl In exportFilesUF.Controls If TypeName(ctrl) = … Continue reading Clear All Check Boxes In Excel VBA Userform

Compile Bill of Materials and Remove Duplicates

This example builds upon the methods of finding duplicate data. See https://pearlsnake.com/2019/06/20/find-and-delete-rows-with-duplicate-data/ In order for a row to be complied, Column A, E and K have to match the data in other rows. After running the example the data was been reduced from 35 rows to 30 rows. This helps purchasing departments so they don't … Continue reading Compile Bill of Materials and Remove Duplicates