Specify WorkSheet To Search & Display Records From

Jul 7, 2006

I have a product Database with 11 columns. I am trying to build a Search/look-up userform.

I found a brialliant example of the same posted by Roy, UK. I have copied the same and its working well, but with a few little problems.

Here's what I've got:

I have a userform with a Combobox (called Combobox2) where it shows all the products from column B in the worksheet "ProductData". In the worksheet "ProductData" , I have 11 Columns with headings from B1:L1.

When user selects a product from the dropdown list (from Combobox2), all the details related to that product from other columns are displayed on the userform via labels.

This part is working fine....except that the values in Combobox2 are taken from activesheet and I want them to come from worksheet "ProductData".
I have hidden the sheet "ProductData".

Second Part is, I have about 20 products in the Database and all of them have a Product Specification Sheet in PDF format. I am just wondering, if there is any way I can have a button on the userform that can used to open this PDF datasheet for the product thats being lookeed up by user.

What I mean is, if user selects productA from the combobox2, then it displays all the info about the the ProductA on the labels on the usewrform. and if user clicks on the "View Data Sheet" button then it opens the Datasheet PDF file for ProductA.

Below is my code for the first part:


Option Explicit

Private Sub ComboBox2_Change()
Dim ws As Worksheet
Set ws = Worksheets("ProductData")
Dim Ncell As Range
With Range("B2", Range("b65536").End(xlUp))
Set Ncell = .Find(ComboBox2.Value, LookIn:=xlValues)

View 9 Replies


ADVERTISEMENT

Search & Display Records On Userform

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

Search Worksheet For Data In Multiple Textboxes On Userform - Display In Temp Worksheet

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

Userform Database: List Records In A Sheet As Well As Search For Records In A Sheet

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

Display Multiple Records In Row

May 2, 2013

How to write a code for displaying multiple data in sheet2 row wise.

I want to use IF condition with for loop.

View 2 Replies View Related

Display Records Randomly

Apr 21, 2007

give me the script (syntax) and place to be written it in a form in ms access 2003.

1. Text box1 should be displayed the value of field1 from table randomly, when I click the command button1.

2. Text box2 should be displayed the value of field 2 of the same record, when I click the command button 2.

View 2 Replies View Related

Unique Records Search

Nov 28, 2009

I have a formula for counting unique text records. However, is it possible to count unioque records based on certain conditions. For example, I have a stats sheet for a sports league and I want to count all the unique teams for dsivision 'North'. Coloumn A has the division, coloumn B has the team they played on that day.

I want to count all the unique records in column B, but based on those teams being in the 'North Division' (column A)

I want to do this with Excel, and not in VBA.

My formula for finding unique records is:

View 9 Replies View Related

Filter Rows To Display Only Records Having More Than One Entry

Nov 20, 2009

I can view the data how I need to by conditional formatting and pivot tables but HR wants to get rid of all rows that: only have 1 accounting line per document such as Doc MI310712 in attached sample So I only want to display records if there is more than 1 accounting line for each document

My understanding of Excel is that in order to get rid of rows that a VBA macro is needed since there is no function to do it. My VBA is limited but is there a way to specify criteria in a filter to hide the rows using a formula?

View 8 Replies View Related

Search Records With Combination Of More Than 2 Values

May 24, 2007

i've written the code below but somehow the output is not what i want.

i have a multiple records and each records contain 30 rows of info i have 3000 over records and they are all in one sheet. i need to find record using more than 1 criteria. I've written the code below. how to use VBA to search for particular strings in cells?

for e.g.
A1 : hello
A2 : world
A3 : anyhow

i want to find the cell that contains "yh" using VBA, and the output should be in cells A3.....

View 9 Replies View Related

Searching And Displaying Data Records By Search Criteria?

Jul 23, 2012

i am trying to create an easy to use search by macro VBA in excel.

I have a sheet of information where i need to find the data records from either one of the 2 search criterias: Name and NRIC.

Once a user enter either of this 2 search criterias, i need a macro to search through the data on Sheet "List" and return the results on the Sheet "Search".

Within the list, a search criteria may appear more than once, the search results should display all of the records row by row on Sheet "Search".

Would it be better to create a user form?

View 3 Replies View Related

Adding Search Function To Delete Matching Records..

Jun 1, 2009

I'd like to do is click the delete button and when clicked, it will search for matching records in column A & B and if they match... I'm thinking the code for that is <> but I'm not sure, then delete that record, and shift the cells up. Do this until the search results are empty below the delete button. Like I said, it's probably more understandable to look at the workbook.

View 5 Replies View Related

How To Get Required Records Only From A Worksheet

Apr 21, 2013

I have a worksheet with a header row.the data is from B2:B25.I have to accomplish two things.

i)I want to get only 8 records (viz record nos-5,6,11,12,17,18,23,24)from the entire worksheet.serial numbers are shown only for illustration purpose.i want to eliminate all other records from the worksheet.then i will get the records from seriel numbers 1-8 as shown in E2:E9.

(2)I want the content of row3 to come up in C2 and then row3 should be deleted. now the content of row4 should come up to C3 and then row4 should be deleted.it should continue.the result will be 4 records as shown in G2:H5

See the attached sample file.

HOW TO GET THE REQUIRED RECORDS ONLY.xlsx

View 14 Replies View Related

Sorting And Filtering The Records To New Worksheet

Jan 14, 2009

I need to do sorting and filtering the similar records to new worksheet. I need you help to do this job, give some idea or command to use for the following steps.

I have attached the worksheet newtran.xls.

1. I need to find the last column, the column will be increased or decreases. so that we need to find the last column at time of running the macro. Now the value is there till column DD

2. I need to concatenate the column B, D, F to last column find out at 1 step. Insert a new column and place the concatenated value.

3. Entire row will be Sorted based on concatenated value column.

4. Find the similar row on concatenated column and entire row need to be moved to new worksheet.

View 11 Replies View Related

UserForm To Populate Worksheet Records

Jan 11, 2010

I've found a great userform on this site that allows you to populate a datasheet as well as delete or amend datasheets. It was by dodger7 within Database. Very useful. I've adapted this to my needs and it works great apart from i cant amend the userform that shows data when you select delete or amend. I've had a go but don't understand how i can create my own feilds and set it up in order. When i go in to the code i can veiw the delete and create/amend userforms but this is a search function relating to a reference number. Once you select Find it brings up another form and that is the one which i need to adapt to show my new feilds. I have attached the sheet so you can see my problem. I was wondering if anyone can advise as i love this userform/database method but can't complete the changes to my needs.

View 2 Replies View Related

Importing More Than 65000 Records Into One Worksheet

Feb 28, 2007

It is so nice to check-in once in a while to see all these new ideas and solutions of people's problems. So, I would like to ask a question that really bothered me for some time, and it looks like I cannot find a full answer to it. So here it goes:

How can I import data which is either more than 65000 records long or it will sum up to be more than 65000 when imported? I need all my data to be on one worksheet, and I don't care if these data will be imported let's say in columns A B C, then once it reaches the 65K, it will be imported to the neighbouring columns D E F, etc.?

I searched the Ozgrid for an answer and I found a thread

importing more than 65K records

View 8 Replies View Related

Search And Display

Mar 19, 2009

I don't know exactly what the function that I am after is, but, what I am trying to do is this:

- Search columns E2:A11 and sort from highest to lowest.
- Place results of the TEAM NAME (Columns A2:A11) representing the highest to lowest in column B16:B25.

View 4 Replies View Related

Excel 2010 :: VBA Code To Connect To SQL And Pull Records To New Worksheet

Oct 18, 2012

i found this code...

Code:
Sub Button1_Click()
Dim cnt As ADODB.Connection
Dim rst As ADODB.Recordset
Dim stSQL As String
Dim SNfound As String
'Your sqlserver 2008 connection string
Const stADO As String = "Provider=SQLOLEDB.1;" & _
"" & _

[code].....

but i dont see where to put in the Database object...

The Database it needs to connect to in SQl is called

The Server name is SQLSRV when you expand databases the database is called SWHSystem the Table is called dbo.Credential and from that i need to get SELECT All from the Name and CardNumber from dbo.Credential and put that in a New Sheet titled Personal

using Excel 2010 connecting to SQL 2008

View 4 Replies View Related

Column Search, Display Non-duplicates

Jul 28, 2009

I have a spread sheet, and i'm new to the macros & VBA world.

I'm trying to generate a search tool that will search through C9:C128 and display the data that does not have a duplicate.

thoughts? can this be done with an excel formula or would it need to be a macro?

View 5 Replies View Related

2 Search Criteria But Multiple Display?

Oct 5, 2011

I want to display multiple results based on 2 search parameters, where by when I enter flight number and Dep. Airport it matches the trip numbers and dispalys all the rows matching all flight number and Dep. airport based on the unique trip number.

Notice: - one trip number could consist of multi flight sectors.

1) Explanation of the data :

MMM1805 = flight Number
935 = dep. time
$AS41 = registration code

[Code].....

View 9 Replies View Related

Userform Search And Display Results?

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

Textbox Search And Display Results

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

Multicolumn Listbox Display-use Search

Apr 24, 2007

I have try whole moring to make the multicolumn list in EXCEL 2003.But failed.

Could anyone have a look at the code and correct me?

In the userform,I have a combobox to select the "client",and I have a multicolumn listboxm, to display the related result for the client which is from sheet"orders"
I am a beginner in the EXCEL VBA, so my code attached in the workbook might be in mess.

View 8 Replies View Related

Search Keyword In Worksheet / Copy And Paste Adjacent Cells To New Worksheet

Sep 24, 2012

I've been tackling this data capture/paste issue for a week or so. I found the string below which does provide a good foundation for my challenge. But, my basic level of understanding macros limits my modifications to meet my needs.

[URL] ......

I have 20 worksheets in my master file corresponding to Excel files individual associates will update weekly. After the associates have updated their individual files for the week, I want to capture the data entered and paste values into a master file containing a worksheet for each associate (sharing the same name as the individual associate file). All of these files are housed on team SharePoint sites.

I need a macro to perform several steps after clicking a "Run Update" macro button in the master file:
Open individual associate fileIn master file, search for each Initiative listed in column B (starting cell B3) in the individual associate file (in column B starting at cell B11)If Initiative is found in individual associate file, copy adjacent data in columns D:J for the respective rowIn master file, paste values to the corresponding Initiative row for the corresponding week's worth of dataIf Initiative is not found in the individual associate file, move to the next Initiative listed in the master fileRepeat these steps for each individual associate file

Linking would be the easiest way to accomplish this if I wanted to have a multitude of weekly individual files for the associates. However, I'd rather each associate have one file for them to update (basically overwriting their previous week's entries).

I need to ensure the paste values corresponds to the appropriate day of the week. In simpler terms, if the date in the individual associate file in cell D9 reads Oct 1, 2012, the data captured from that row needs to be pasted to the corresponding row/column in the master file that reads the same date.

View 2 Replies View Related

Combining And Rearranging Data Records From Multiple Worksheets To A Single Worksheet

Sep 13, 2009

I have a set of related variables that are split over multiple worksheets, and I need to be able to take specific information, duplicate certain values and produce an output sheet for use in a separate piece of software.

The variables are:
Position Number (Sheet 1)
Position Title (Sheets 1 and 2)
Position Requirement (Sheet 2)
Requirement Importance (Sheet 2)

The output sheet requires a list of all the requirements for each position number, which means the position number itself needs duplicating (in new rows) X number of times, where X is the number of requirements assigned. The appropriate requirements are then to be pasted in next to each position number (and the requirements can be found by comparing position number to title, and from title to requirements).

Normally, I’d be able to do this using lookups and so forth, but my problem arises when I have multiple position numbers with the same related title (in the attached example, there are three plumbers with unique position numbers). I can’t figure out how to say to Excel “a plumber has five requirements, and there are three plumbers, so duplicate each position number for each plumber five times, then insert the appropriate qualifications (and their associated importance values) next to the position numbers”.

View 4 Replies View Related

How To Get Excel To Display Only Rows Containing Search Criteria

Apr 18, 2013

I want to be able to view only the rows containing search criteria.

For instance, if I search for the word "sandwich", I only want to view rows containing that word. How do I do that? Or... Is there a way to group the rows containing the word "sandwich" together.

I have about a thousand rows that I need to sort and distribute to different worksheets. I don't want to work through the list moving single rows or small groups of two or three at a time.

View 3 Replies View Related

Search Database And Display Results W/ Pictures

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

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 View Related

Trying To Use VBA To Concatenate And Display Search Results On A Userform

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

Search By Employee Id- Display Rows On Another Sheet

Aug 18, 2009

On sheet1 I have this:

employee ID Date hours item1 item2 item3 item4

So it's 8 columns and the row count can vary.

This list on sheet 1 has the persons employee id and various bits of info. There will be multiple rows with the same employee id. This data is not sorted in any particular order, but I'd rather leave this sheet untouched.

On another sheet, I would like the user to simply type in a number for the employee id (I don't want to use msg box, just a cell is fine, maybe a button form to click search to run the macro) and it lists all their hits, however many rows that may be. Again I can't sort the original list so the employee might have hits scattered throughout the main list.

So they would enter the employee id and below that they would get all the rows with all the above data where they get a hit. One concern I have is say the first search for employee 123456 turns up 18 results. Then they search for employee 123444 and it only returns 8 results. I don't want the last 10 rows of employee 123456 to be still present. Basically a search that searches another sheet and returns any hits, and it clears the list of previous search results so for each search you only see the results of that search and not old data.

View 9 Replies View Related

Search And Display Results On Columns In ListBox Of Userform

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







Copyrights 2005-15 www.BigResource.com, All rights reserved