Hi,
Since starting my job i have been using excel more and more often and going from actually hating excel and wanting to throw the computer out of the window i find myself reasonably able at it now and have wrote codes in spreadsheets which have been very useful for modelling and analysing data. Im now using excel as a tool to develop ideas of my own and optimise processes my department uses which brings me onto my question....
I would like to make a workbook which can open a macro and search a database (stored in a hidden sheet within the workbook) of contacts. These contacts will have the following attributes assigned:
- Full name
- Phone Number
- Job title
- Department
- Site location
I would like to be able to search one or more of these criteria at any one time similar to an internet search engine for a used car website for example.
After the search results have been generated i would like a selection of desired results to be "checked" (maybe using a checkbox) and populate a table contained in a visible worksheet. From there i will be able to do a further analysis but i already know what i am going to do at that point.
Another problem that concerns me is that i would like the results in the populated table displayed within the departments of the names so im thinking the code will somehow have to govern how the populated table is constructed!
Although i have used some of these skills like command buttons and checkboxes on other project of mine, Im not too sure where to start when writing the code for the user form. Any suggestions would be much appreciated!
You can do the first part with advanced filters.
The DB is on Sheet2 and the criteria range runs down the first 6 columns of Sheet1. With this format you can do any combination or ANDs and ORs by following the normal rules for use of advanced filter.Sub MyAdvancedFilter() Sheets("Sheet2").Range("A1").CurrentRegion.AdvancedFilter Action:=xlFilterCopy, _ CriteriaRange:=Range("A1:F" & Range("A1").CurrentRegion.Rows.Count), CopyToRange:=Range("H1:M1"), Unique:=False End Sub
Martin
Eighty Twenty Spreadsheet Automation http://homepage.ntlworld.com/martin.rice1/ for all your Excel customisation and consulting needs.
If my solution has saved you time and/or money, please consider donating to Cancer Research UK.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks