Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Using VBA Search in all workbook using data entry form

0

Hi i saw your videos, i just started learning VBA codes using Excel, i am used to do pivots and using functions, and it gets too laggy for excel when inputting many functions, link workbooks and putting arrays so they go alphabetical. however seeing your videos im inspired to study and learn and want to try out this VBA,

what im asking to do is, i started with Data Entry using VBA userform. As seen on your video you used it using Excel worksheet, i would like to ask if you have a tutorial for viewing the result using listbox in the userform? 

thank you so much,

Answer
Discuss

Discussion

Hi there! I'd go to the youtube channel for TeachExcel and search for UserForm and I made a few videos on that there - I'm not sure if they meet your requirements exactly but, I do believe that you will learn how to fill the listbox or combobox in that tutorial and then you just need to get the inputs from wherever you want to get them and then it will fill the listbox or combobox how you want.
don (rep: 1989) May 13, '22 at 10:02 am
Add to Discussion

Answers

0

Hi Levin and welcome to the Forum

As Don suggests above, please see his video here Excel UserForm Course 2 - Menus, Lists, ComboBox, OptionButtons, CheckBox & More. Better still, purchase his excellent full Excel VBA Course - Beginner to Expert!

In the attached file, I've used an alternative method (using the RowSource property of the ListBox). I've added a form (called UserForm1) with control Listbox1 and in the Data_Search sub, added these lines at the end of the sub (after the results have been added to the worksheet):

Sub Data_Search()
' TeachExcel.com

'  <<< Existing code >>>

' set the row source for UF Listbox (with Headers set to True, from row above source)
With dashboard
    Set Rng = .Range("B11:N" & .Cells(.Rows.Count, 2).End(xlUp).Row)
    UserForm1.ListBox1.ColumnCount = 13
    UserForm1.ListBox1.RowSource = Rng.Address
End With

'display the UF
UserForm1.Show

'Application.ScreenUpdating = True 'Turn it back on at the end of the macro!

End Sub

Just click the Search button (as before). The row headers are then obtained (from the row above B11:N11) and the results displayed in the form. Note that I've set all the column widths to the same.

Hope this helps. If so, please don't forget to mark this Answer as Selected (for the guidance of others and to add to our reputations in this Forum).

Discuss

Discussion

Levin. Did my Answer help?
John_Ru (rep: 6102) May 19, '22 at 7:19 am
I guess that's a "no" then! 
John_Ru (rep: 6102) May 26, '22 at 10:23 am
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login