Pull data from table into userform

Fractalis

Active Member
Joined
Oct 11, 2011
Messages
310
Office Version
  1. 2019
Platform
  1. Windows
Hello to all in forum,

I have a database in sheet1 with 5 columns (A-E). I would like to have a VBA userform that allows me to select books by genre shows me within the userform all rows for that genre and columns A,B, D and E.

Example: Having a list of genres in the userform, select "Action", and in the userform should display 3 rows
I really new with VBA userforms. May somebody help me sh0wing me how to pull the data based on genre and show the
result table inside the userform.

Genre
Title
Year
Author
Read
Drama
Drama_1
1980
John T.
130
Romance
Romance_1
1983
Mary D.
215
Action
Action_1
1986
Jane M.
300
Romance
Romance_2
1989
Mary D.
120
Children
Children_1
1992
Paul S.
381
Action
Action_2
1995
John T.
87
Fantasy
Fantasy_1
1998
Kevin W.
95
Children
Children_2
2001
Mary D.
103
Action
Action_3
2004
Jane M.
204
Horror
Horror_1
2007
Kevin W.
167

<tbody>
</tbody>

Thanks for any help.

Regards
 
You can do all of that via Excel's built-in Data Form. How about you take a look at that before we go trying to "reinvent the wheel"!
 
Upvote 0

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Hello Garry2Rs,

Thank for you help.

Actually I want to accomplish my goal in the easiest, "best" way. If there is no need to involve VBA code is better.

With a Built-in userform, I would be able to add/erase/edit data and visualize the scattered data like you've done with your userform code?

How would you do it what I want to do?

Please advice.

Thanks again.
 
Upvote 0
Select the sheet containing the data;
In XL2003:
Data>>Form...

In XL2007:
Click arrow next to Quick Access Toolbar;
Click 'More Commands';
In the 'choose commands from' box click 'All Commands';
Select the 'Form' button in the list;
Click 'Add'
Click the new button to display the Data Form
 
Upvote 0
Hello Garry2Rs,

I've tried the Built-in form. The entry/edit data option is pretty good, but to visualized the data is a kind of limited.
Only let see the data of one record at a time and not the whole table for one department. I think is not what want
to get, that is to visualize within the userform in a grid window or listbox set, all the data for a especific department
and be able to edit/change values and update the main database automatically.

Any help or idea in a good way to do this would be very appreciated. If userform is a good option, the help to mix the
entry and pull procedure.

Thanks in advance.
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top