Excel Vba Userform Examples Free Download

Free Excel Training - 10 Lessons (Over 100 pages) This is a Free Excel Training with 10 different lessons. The lessons teaches the fundamentals of Excel like Cut/copy/paste, Custom formatting, formulas, useful functions & the insert function, calculations, effective printing, data sorting, autoformats, creating a charting spreadsheet, password protection, the if function and nesting. Download Now: ListBox in Excel VBA: A Sample Supermarket Application to show examples on adding new items, clearing, selecting multiple items and changing various options of ListBox. Read More: Download Now: Collections in Excel VBA: Download the files and see the examples one Collections. Nov 30, 2020 How to make Login Form in Excel and VBA. Transfer Data from Microsoft Excel to Google Sheet. Showing Multiple Lists in a Single ListBox Dynamically. Create a Dynamic Map Chart in any version of Excel. Use Live Excel Charts as a Tooltip on Mouse Hover. UserForm Events in VBA. Time and Motion Tracker. UserForm and Multiple Option Buttons in VBA. As you see this is the second and last part of the tutorial 40 Useful Excel Macro VBA examples. In previous article i had published the first 20 examples. Download a FREE Excel Workbook with all 40 Examples. At the end of this article, you will have a link to download a FREE copy of all 40 useful excel macros collection.

The benefits of using the userform are indisputable in order to enter data into the worksheet and analyze the data on the page more easily and to make changes on the data.

May 08, 2018 Excel Vba Templates Free Download. 46 Excel Vba Templates Free Download. Vertex42 Template Gallery Excel Addin Powered by Ribbon. Download Free Excel Dashboard Templates Collection Of. 6 Vba Excel Templates Exceltemplates Exceltemplates. 6 Vba Excel Templates Exceltemplates Exceltemplates. Pin De Kadr Leyn Em Excel Tutorials and Excel Advanced.

For this purpose, we designed a userform with advanced features. Unlike other userforms -as well as record adding, deleting and editing features-, we have added features such as listbox multiple selection feature, advanced search feature, textbox that shows the index sequence number . The item or items selected on the listbox can be copied to the other sheet.

We also made changes to the userform record editing feature. The change that made on the record can be visibled immediately in the listbox and worksheet.

With buttons can be navigated between the listbox items and the cells on the sheet . When the index number is entered in the textbox (TextBox15) in the middle and the “Enter key” is pressed, the item with the index number is displayed at the top of the listbox (ListBox1.TopIndex) and on the worksheet.
Private Sub TextBox15_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode <> 13 Then Exit Sub
On Error Resume Next
If IsNumeric(TextBox15.Value) Then
If TextBox15 <> Empty Then
ListBox1.ListIndex = (TextBox15.Value) - 2
ListBox1.TopIndex = (TextBox15.Value) - 2
End If
End If
End Sub

Excel Vba Userform Examples Free Download Free

Userform, listbox multiple selection and selection by pressing “Shift” and “Ctrl” keys have been added.

For listbox single select code : ListBox1.MultiSelect = 0

For listbox multiple select code :ListBox1.MultiSelect = 1

To select listbox items by pressing “Shift” and “Ctrl” keys : ListBox1.MultiSelect = 2

We have used a checkbox to select all items of the listbox and deselect items.

The item or items selected from the listbox or all listbox items can be copied to the “SelectedData” sheet by pressing to the button.

To copy from listbox to sheet :

Sheets(“SelectedData”).Columns.AutoFit The width of all columns of the SelectedData sheet is automatically adjusted according to the cell content.

If Not Sheet_Exists_Cntrl('SelectedData') Then
Call New_Sheet2
End If
With these codes, SelectedData sheet is created if it does not exist in the workbook.

Excel Vba Userform Examples free download. software

VBA codes to check if a worksheet exists (We added the user defined function to Module1.) :

If there is no “SelectedData” sheet, the procedure to create it is as follows :

We added the textbox(TextBox13) on the userform to search in the sheet. The user can select the column that want to search from the drop-down list. We selected 4 columns to search data. When the userform opened ,To list these column headers in the drop-down list ,we added the following codes to the Userform_Initialize method .
With ComboBox1
.AddItem Sheets('Data').Range('A1').Value
.AddItem Sheets('Data').Range('B1').Value
.AddItem Sheets('Data').Range('D1').Value
.AddItem Sheets('Data').Range('L1').Value
End With

As seen in the picture above , we used the following procedure to open the combobox without pressing the button(arrow on the right) .
Private Sub ComboBox1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
End Sub


We used the AutoFilter method to search data faster in the worksheet and display results in the listbox. The filtered data by AutoFilter method is first copied to FilteredData sheet -if this sheet there isn’t in the workbook, it is created and hidden by the function-. The copied data to the FilteredData sheet is listed using Listbox List method on the userform.
ListBox1.List = Sheets('FilteredData').Range('A2:O' & Sheets('FilteredData').Cells(Rows.Count, 1).End(xlUp).Row).Value

Vba Excel Template Download

We added a progress bar on the userform. Userform progress bar informs to the user whether the operation (the ran macro) has ended or not.

Excel Vba Userform Examples Free Download For Windows 7

The Main () procedure that we created is called to run the Progress bar.