Need help I have 4 columns of information and i want to use a userform to search these four columns for a specific number then display in a message box what column(s) it found this value in
Can anyone help me?
Need help I have 4 columns of information and i want to use a userform to search these four columns for a specific number then display in a message box what column(s) it found this value in
Can anyone help me?
Hi Tiny4725,
welcome to forum.
See the attached file and run the macro using button.... let me know if this helps. thanks.
Search and display column.xlsm
regards,
DILIPandey
<click on below 'star' if this helps>
DILIPandey, Excel rMVP
+919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com
That helps but what i would like to do is be able to display multiple locations for instance if the value 15 is in column 1 and 2... i do have header row so i could display the value at the top of each column... basically i have programs used on on our production lines and there is a list for Line 1, Line 2, never Run, and 1st time runs. so I want to be able to search that if the program exists any of these locations it will tell me and it could be in several locations
Okay..
Would you be able to upload your sample workbook... thanks.
regards,
DILIPandey
<click on below 'star' if this helps>
Here it is
Hello there,
Attached is a sample workbook. Try it out by selecting the command button and let me know if this works for you.
If this seems like this can work for you let me know and I will incorporate it into your workbook that you uploaded.
Thanks!
Yeah I do think that will work thank you
Okay attached is your original worksheet updated to include the forms.
To try it out try 69011210 then click search, double click on an item in the list to be taken to the cell.
Thanks!
RVASQUEZ
Thank you this works... but one question it will crash Excel if you seach with nothing entered, how would i put a limit on how far it searches, or could i say type End somewhere in the workbook and have it look for that when nothing is entered into the search box?
You can add an exit to the click after the binding of the textbox value:
![]()
Please Login or Register to view this content.
Thank you this works great
Hello there,
I have attached an updated workbook. This one incorporates the code from rkey above as well as tells you if there are no Results found.
Thanks!
Ok so i thought this was solved but i just ran into something, it can not find anything in engineering column because there is a "SMT 1" or "SMT 2" that usually follows it(i didnt have this in the file i had uploaded. so i guess i need to search for any cell containing the value, not matching.
Hey there can you reattach an example so I can try and find a workaround?
Thanks!
Here is the file I am currently working on
tiny4725,
Attached is a modified version of your most recently posted workbook. I made several changes. First, I got rid of the 2nd userform, that was unnecessary. Here is the full code for the userform SearchForm:
![]()
Please Login or Register to view this content.
Changes made to the userform:
- Changed the naming convention for the controls
- Removed the frame
- Setup a proper tab order
- Made the search button the Default so that pressing enter causes that button's code to run
- Double-clicking a search result item will still take you to that cell and close the userform
- The listbox is now a 2 column listbox. The first column contains the cell address, the second column contains the dislpay text of the cell
Hope that helps,
~tigeravatar
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
Ok thank you everyone that does it
You're welcome. Out of curiosity though, why not just use Excel's built-in FindAll feature?
well to be honest it is for the people that will be using it, hitting CTRL+F or selecting find just a little to hard for them so i figured a Big button would do
Okay I'm not sure if how I did it is the quickest or easiest way but try this.
Let me know if it works!
Thanks!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks