Search Through Database And Display Results In Userform
Jan 17, 2009
I have a database of 13 columns and ever increasing rows.
I want the following to be there on my userform.
1 combobox: showing the list of categories from which to search.(The categories are the column headings in columns A1 to A13.The user will have to select one category.
1 textbox:Here the user will enter the search term.
1 Command Button: When the command button is clicked/entered, the code shall be such that it will search in the column corresponding to the category mentioned in the combobox and display the results( The entire 1 row x 13 cloumns containing the search term) in a Listbox. If the search term does not matches then a message box should appear with the message "No entries found"
[b]
1 Listbox:to display the search result as mentioned above.
View 13 Replies
ADVERTISEMENT
May 28, 2007
I have very little experience with programming, as a matter of fact the code in the sample file is the extent of my knowledge. I want to use Excel because not everyone in the plant has access to Access, but everyone has Excel.
The idea is to allow searching for parts based on 2 different part numbers, category, drawer, manufacturer, or description (any or all).
My first problem is how to make excel search using a userform and find multiple results, not just stopping after it finds the first match. For instance if you only searched for a category it should find all results that match that category.
(I'll try to anticipate a question here: the part numbers should be unique but may not be, so using the part number as a key will not work.)
The second thing is I would like to know how to populate these results in a listbox and and have the selected part show the matching picture. (This maybe more clear after seeing the spreadsheet).
And finally, is there any way to make the comboboxes on the search userform populate themselves off of the list of data.
I apologize if any of these questions have been answered already but frankly I've been searching google for the past week and haven't found anything, (This may attest to my search skills as well, ha ha ha), and I really just want this to be finished.
View 14 Replies
View Related
Oct 17, 2012
I've put together a workbook that has 2 sheets that contain stock details and location info (i.e. part number, description, Location & stock level). I need to have a search function outside of the 'built-in' Ctrl+F (or Edit > Find) search function, i'd assume this would mean using VBA?I invisiage making a userform embedded within the very first sheet of the workbook and having this form be opened when accessing the worbook - maybe hide the other two sheets containing the data? Within the search userform, i would have a 'part number' & 'description' search input boxes for data input, either one could be blank but atleast ONE must be inputfor the search to work. On pressing the 'Search now' command button in the userform, any reults found would be displayed in a listbox at the bottom of the said userform. If no results found, a dialog box would pop-up saying 'No Items Matched"
View 7 Replies
View Related
Sep 16, 2009
I'm using a userform to report on set of worksheets. Two of the functions are:
- reporting on the number of contacts with a client
- displaying the details of all contacts with selected client in one textbox.
I can't work out how to concatenate the text of all the contacts relating to one client in a text box (txtContactHist) on the userform.
Using the countIf function I'm trapping zero matches.
The worksheet containing the contacts has the following data columns:
Col A - Customer ID
Col B - Detail of contact
Col C- Date of Contact
Columns B and C contain the data I want to capture
Column A (the customer ID) is the column that is searched for a match ( via the userform text box (txtLic.Value))
To work out the total number of contacts, I use this bit of ...
View 6 Replies
View Related
Apr 21, 2014
I am creating a database using excel and I've created a userfrom for ease of data entry and searching the database. But now I am stuck at the searching part.
The sheet is Sheet1 and the userform is UserForm1. Based on the pic that i have attached, user needs to key in the keywords in any of the textboxes and comboboxes in the group box labelled "Organizational detail" and when he/she clicks on the Search button, the userform will display the whole rows where the search results reside onthe listbox. When the user click on the search results on the listbox, the textboxes and comboboxes will be updated with the data on the listbox.
View 3 Replies
View Related
Apr 27, 2006
I have a spreadsheet with 2 columns, 'A' is the property number and street name, and 'B' is the year the work is going to be done on the property.
I have a form with a textbox and command buttons, now what I want to do is allow the users to enter property number and street in textbox1 and click commandbutton1 to search. If it finds a match I want a small message to come up and say either the year the work will be done (column B) or 'no match found'.
View 8 Replies
View Related
Apr 16, 2014
I have a userform that simply filters data on a spreadsheet through checkboxes. The form is filtering columns (B through N) to shorten the list of possible outcomes (data in column A.) After the user is done with the form I'd like to populate the data in column A (the results from filtering and there is no way to pre-determine how many rows will have data) with the user pressing a button on the form, into something the user can see without going back to the spreadshet. I was thinking I could populate the results into some field on the form; maybe a list box, txt file, using the camera function in Excel?
View 2 Replies
View Related
Jan 15, 2014
Below is my current code. The strFind1 searches for a name within the database and then I need strFind2 to do a exact for a Subproject search and a partial search for everything containing the Subproject selected and other Subprojects. Currently, when the database entry in the worksheet includes Subproject 1 the search function works but when I have an entry that contains Subproject 1/Subproject 4 it does not find the entry. How can I expand the strFind2 to equal what is selected in the Combobox2 and find entries that have what is selected plus more text. I have set the line where I think everything is going wrong to a bold format.
[Code] .....
View 2 Replies
View Related
Sep 20, 2007
I am trying to populate a UserForm with data from a spreadsheet using a search function instead of just providing a Next and Previous search function (which works). The following code is able to search for and select the correct row on which the data resides.
Private Sub cmdBlankFind_Click()
Dim FindMe As Variant, FindCell As Range, FindCell2 As Variant, Data As Variant
With Range("BLANK")
FindMe = InputBox(Prompt:="Please enter search criteria:")
Set FindCell = .Cells.Find(What:=FindMe, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False)
FindCell.EntireRow.Select
Data = FindCell.Value
tbxBlankAccount.Value = Data(1, 1)
End With
End Sub
View 9 Replies
View Related
Oct 24, 2011
Any way to use a search form I've created to delete data from the original sheet. What I'm doing here is using advanced filter to copy data from the original database onto a temporary sheet to display in this list box. I've gotten almost everything to work properly, but since this is populated by advanced filter, I don't really even know where to start on my delete button.
Code:
Private Sub Search()
Dim Criteria As Range
Dim SearchRange As Range
Dim SearchResults As Range
Set Criteria = Range("Values!Criteria")
[Code] ......
So I was thinking something like this:
Code:
Private Sub cmdDelete_Click()
lstResults.Value.delete
End Sub
But I know this won't work.
View 1 Replies
View Related
Jul 3, 2006
I am very new to Excel/VBA. I have created a "Customer Complaint System" in excel and have designed a user form for users to enter new complaints.
My next step is to design a Search or Look up form for viewing the complaints where users can choose to look up complaints by either Complaint No or Customer or Month.
The worksheet that stored my data is called "ComplaintData" which is hidden. In the sheet "COmplaintData" I have following 10 Columns:
Column A - Complaint No
Column B - Date
Column C - Customer
Column D - Contact Person
Column E - Product
Column F - Batch
Column G - Category (This relates to Complaint Category)
Column H - Description
Column I - Account Manager
Column J - Month (This just takes value from B and converts to month, so hopefully I can sort by month if required..)
I did see a few examples of look up forms but am struggling to customise them to suit me.
Ideally I need a combobox & textbox in serach field. So user can choose the "Search by" category using combobox e.g. Complaint No, Customer or Month and then enter the relevent text in the textbox to carryout the search.
and then use labels & listbox to display the related fields on the form. The reason I prefer labels is that I do not want users to edit the info. and listbox to show multiple results out of which user can choose specific one....e.g. when user does a search by Customer, I want listbox to show the various products that customer has logged complaints for.
View 9 Replies
View Related
Apr 17, 2014
Currently I am working on a data entry form for CRM database using Excel. Now i am stuck at filtering and displaying the data from the spread sheet to the user form.
There are three text boxes to key in the filter criteria and a button which will filter the data from the spreadsheet based on the criteria in the three text boxes. Then the whole row where the filtered data resides will be displayed on text boxes on the user form.
View 5 Replies
View Related
Dec 29, 2007
I need a code for vinculating a user form and perform some searchings on a excel database.
For further details see attached file.
I created a user form in which some infromation is requested in order to search on excel database, I need a macro to search, display and update this data/information.
As an example, if i need to find the part number "C23138810-1" using the button search database and contains or match options, then displays all the information on the user form, this information is located in the same row where the part number is. Then, if some change is required, update is by clickig button "Update Data", and then if require "find next" item to review or update.
View 9 Replies
View Related
Dec 23, 2013
I have a workbook with 4 worksheet that store different type of data. It also has a userform that load at start of the application which is to search the data in the workbook. The userform has a combobox where the names of the sheets are stored. when the user selects say Sheet2 in the combobox, it enables the relevant textboxes on the userform and activates the worksheet at the change event. The userform has a search button that searches all the worksheets based on the text entered in a textbox.
The problem: how to search based on 1 textbox. What I want is: say for e.g the end-user selects sheet2 from the combobox, this intern enables 4 textboxes (Name, DOB, Nationality, ID #) on the userform. The end-user should have the liberty to enter data in 1 and/or any of the textboxes. The search should be performed, that if data is only in 1 of any of textboxes then give all rows that fit that criteria and display in a temp worksheet. if say the name and dob is filled by the user than what matches both should be displayed in a temp worksheet. if say dob, name and ID# given so the search button should narrow down to fit all 3 criteria and then display result in temp worksheet. As if mentioned data can be entered in either just 1 or any or all textboxes.
E.g. the worksheet is (Columns are Name, Nationality, DOB, ID#)
row 1 = name: Steven Martin, DOB: 27-may-1993, Nationality: Trinidad & Tobago, ID #: 1234567
row 2 = name: Gary Richards, DOB: 2-FEB-1993, Nationality: British, ID #: 456789
row 3 = name: David Cohen, DOB: 27-May 1993, Nationality: American, ID #: 98765
row 4 = name: Roberto McDonalds, DOB 21-Jul-1962, Nationality: British, ID # 654321
row 5= name: Gary Richards, DOB: 01-Dec-1978, Nationality: Australian, ID # 1234567
Now if the user enters only name as "Gary Richards" and search then row 2 and 5 should be displayed in a temp worksheet. if user enters name Roberto McDonald and ID# 1234567 then it should not display anything. if user enters DOB 27-may-1993 and nationality British and ID # 1234567 then as well shouldn't display anything and should a msgbox "no data found".
View 4 Replies
View Related
May 7, 2006
example of a database user form that will allow me to list records in a sheet as well as search for records in a sheet. I know excel has a built in feature for this but it is menu driven and I need something that is button driven and will allow me to resize the form layout. I was not able to figure out how to do that with the built in form.
View 7 Replies
View Related
May 28, 2014
I've got an question about using excel macros to search for information in a database with certain restriction. In my attachment you can see an example of the database I use.
Example.xls
I've got a database with certain packages, the length and the width of these packages is known.
I've also got a database with certain products, the length and the width of these products is also known.
I want to use a macro which allows me to see which packages are useable for a certain product. A package is useable if the length/width is less then 10 bigger then the product. So in the example if the width is between 10~20 and the length between 40~50.
Originally I thought I could use a macro with advanced filter and having restrictions width >10 <20 and length >40 <50. But I can't fit this in as macro because I already get the width and length from the product from another database and macro so it can't say >40 only 40.
View 4 Replies
View Related
Jun 11, 2008
I'm trying to get certain data from an export of a phone logging report for a call center. I have exported this data into an excel spreadsheet. I would now like to retrieve the following information from the sheet.
'Agent name, Date, time of Login, time of Logout (at end of day).'
I have coloured these fields in red for easy finding. I do not require anything else from this data, however, within this sheet there are multiple agent names and can span for over a month. All names and dates are required. I have attached the current sheet, and also what it will possibly look like once complete. I would prefer the whole process to be automated if possible.
View 2 Replies
View Related
Aug 24, 2009
I have created a query in an Access database which returns multiple results. I need to be able to run this query within Excel, but only showing the total of the results in a single cell.
I also need to run it multiple times on the same sheet using different dates. The Access query asks for a date each time it's run
I have only found ways to retrieve the entire results of the query into Excel based on the settings within the query.
View 9 Replies
View Related
Nov 2, 2011
I have a database sheet with all the data, I want to make a query sheet that display the rows of data when I enter the data in the summary sheet. I have 2000 rows of data and about 24 in type(columns)
So if I enter in cell Hona and Miles 50, it will display all the rows in the database sheet that contain those data...so I assume I would have to insert some kind of formula, or is there a simpler way to do it with out VB/database...
Car Miles PriceGasColor
RaceCar 50 Over1.5Red
Honda 100 Over2.5Black
Lexus 200 Over 3.5Silver
View 4 Replies
View Related
Nov 6, 2012
I am a Microsoft Excel 2010 user and am trying to create a usage report for a website that I work on. I have been compiling the usage reports into one spreadsheet. The columns I use are Month, Device, Language, Title 1, and Title 2. I can filter each of these rows and it shows me the number of records found. Each row on this spread sheet refers to a time that someone selected something on the site. For example the row may say;
Month (filtered)
Device (Filtered)
Lan (filtered)
[Code].....
How do I automatically populate a table on a separate sheet with the number of records found for a certain combination of filters applied. So if I'm looking at monthly trending I want to know how many times the stress test was started in May, June, or July, but automatically using info from the multiple filters.
What is a formula I can use to compile the filtered data from above.
Jan
Feb
Mar
Aprl
May
Start
=formula?
View 4 Replies
View Related
Dec 26, 2013
I need to search for 3 parameters, L, M and P based on the *** and age from the attached excel file wtageinf.xls and enter them into the formula below
((X/M)**L) - 1
Z = -------------------------, L≠0
LS
or
Z = ln(X/M)/S ,L=0
where X is the weight of the child. The formula is for the Z score.
View 1 Replies
View Related
May 29, 2009
Search Excel Database - Modification ...
View 9 Replies
View Related
Aug 18, 2006
I have a database saved in sheets on a book of excel, each sheet contains different year operations, for example sheet named 1994 contains the operations made on 1994 and every sheet is got information storage with the same criterias, for example: on every sheet there is a column named country code, operation code, status..etc.. what i want to do is to build a tool that would allow me to search through my database. With this I mean, that the user would be able to check different options on a check box or select from different lists inside of the check box the option that they want the operation to have and that the program would search through the whole book the operation/s that fulfill all of the requirements that user set beforehand.
View 4 Replies
View Related
Aug 21, 2012
Have the following code:
With iSheet
i = .Range("A" & Rows.Count).End(xlUp).Row
j = .Cells(1, Columns.Count).End(xlToLeft).Column
.Range("A1", .Cells(i, j)).ClearContents
[Code] .......
If I use F9 to pause the code before the sort part in blue, then the data imports into Excel from the database and then subsequently pressing F5 sorts the data as required.
However, if I run the macro in a single pass, the data does not sort. Why it's not sorting as expected and how to make it sort as required?
View 1 Replies
View Related
Apr 4, 2014
I want some code on how to fetch data from an Excel Database and display it on respective textbox.
Like I have these coloum name in excel sheet; Emp Id
Name
DOB
Dept
Reporting to
Transport req.
I want to have VBA code to fetch it on txtbx1, txybx2 and so on.
View 1 Replies
View Related
Nov 12, 2006
Using the code below, I search a database (Sheet1) on a pallet number and display in the listbox all the items on that pallet.
Assuming now that the pallet has been "worked" or despatched, what code would I use to delete that pallet and all its items from the database?
Private Sub cmdFindAllPal_Click() 'Find all Pallet
Dim FirstAddress As String
Dim strFind As String 'what to find
Dim rSearch As Range 'range to search
Dim fndA, fndB, fndC, fndD As String
Dim head1, head2, head3, head4 As String 'headings for list
Dim i As Integer
i = 1
Set rSearch = Sheet1.Range("b7", Range("b65536").End(xlUp))
strFind = Me.TextBox2.Value
With rSearch
Set c = .Find(strFind, LookIn:=xlValues, LookAt:=xlWhole)...........
View 9 Replies
View Related
Nov 14, 2006
I have written an array formula which you can see in the, "Done something cool in excel" bit on here. Part of this project was to changed/replace three diffence cells on each pass of the loop. I used some code off here which allowed me to display ALL changed on a seperate sheet, but there way way to much data on here and really confused the user. What i would like to do is; in 1 column, for it to say "CHANGED" if the data has changed "EXSISTING" if it hasnt changed and "NEW" if its been added, this will be referencing Column I.
View 7 Replies
View Related
Feb 12, 2014
I have created a form that will add new records to a database. On the database there is a predetermined ticket number. The "Create" form looks for the first blank row and adds the information on the form the database.
What I am trying to make happen is when a "Ticket Number" is entered in the appropriate field on the "edit" form, the "Date Raised" and "Raised By" fields populate based on the information stored on the row for the ticket number enter.
View 3 Replies
View Related
Feb 12, 2010
I have created a userform on the "Database" sheet that has a listbox at the bottom that populates with records when I search for someone using the 'Name' box.
The problem that I am having is that when I enter "Person" and get the 30-odd records appear in the listbox, I click on say Person 5 BUT the userform fields do not update themselves fully with the correct information.
I found the following thread ....
View 10 Replies
View Related
Oct 10, 2011
If the results are < or = to 60, then I want result to be green. If the result is > 60, then I want to result to be red
View 2 Replies
View Related