+ Reply to Thread
Results 1 to 22 of 22

Search individually on each column

  1. #1
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Search individually on each column

    Hello,

    I added this code so that I am able to search column D besides column B.
    But since I added it, I am not able to either search column b nor D. I think I am missing something on it.
    Please check. Thank you

    Please Login or Register  to view this content.
    Without the added code above, then column B search work.

    This is the entire code with the one I added (see the attachment too).

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,862

    Re: Search individually on each column

    Are you trying to filter columns B and D on the same value (sFind)? Looking at your data, those columns have entirely different values. Please clarify in detail, step by step, what you want to do.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Search individually on each column

    Hi,

    I am trying to filter one at a time. Let say if i filter somwthing from B column then after I filter “all”. The. if I want to filter something in D column after then filter all.

    I just not sure if possible. Or the I create another button macro for column D

    thanks

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,862

    Re: Search individually on each column

    Try the attached file. You will notice that in order to filter the data properly, you need headers in row 2 of each sheet. CHange the headers to suit your needs. When you click the "Filter Data" button, you will be asked to enter the desired column letter and then for the search criteria. Before you click the "Filter Data" button again to choose a different column and search criteria, click the "Remove Filter" button first.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Search individually on each column

    Mumps1,

    I loved this even more.
    Can you do one more thing, please. If you can add that if I enter a data from the message box and it's not listed in my worksheet then a message box will appear "no data listed" then "cancel"...something like this.

    Thanks

    Please Login or Register  to view this content.

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,862

    Re: Search individually on each column

    Try:
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Search individually on each column

    Hi

    Okey... yay! Let me try

    thank you

  8. #8
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Search individually on each column

    Hello,
    There is just one thing.
    Can I remove this "MsgBox (sFind & " does not exist in column " & UCase(col) & " of sheet '" & ws.Name & "'.")" but I don't what else to remove besides this.

    What happen is that when I am in Sheet1 and search "Robert" then it keeps popping up and saying that there is no Robert in Sheet2.

    thank you

    Please Login or Register  to view this content.

  9. #9
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,862

    Re: Search individually on each column

    If you can add that if I enter a data from the message box and it's not listed in my worksheet then a message box will appear "no data listed"
    I understood that you wanted a message to let you know if the search text is not listed. Since the macro loops through all the sheets, you will get the message for each sheet if it is not listed in that sheet. If that is not what you want, please clarify in detail.

  10. #10
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Search individually on each column

    Hi

    When I filter, it actually filter the particular activesheet which is Sheet1.

    I am sorry maybe I did not explain correctly or maybe I just realized that its doing that.
    My English is not good... sorry.



    Thank you in advance!

  11. #11
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Search individually on each column

    Mumps1

    I figure it out. I removed one of the and it did work.

    Just very one thing. My original worksheet has a big or large entries. And when I filter, it does not show anything but if I click the page up then there you are.

    How can I or can you add "page up" with the code so that I don't have to click it all the time?

    Thank you so much. I think I almost done with it.

    I really appreciated.

    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Search individually on each column

    Hi,
    I added this
    Please Login or Register  to view this content.
    but when I press it "ok", then I have to press it several times before it exit. Just want to press it once and it does not to search to the othersheet.

    Also, don't forget to fix that filtered that the filter are on the top page.

    Please.... thank you so much.
    Last edited by RJ1969; 03-12-2023 at 09:12 PM.

  13. #13
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Search individually on each column


    Quote Originally Posted by RJ1969 View Post
    then I have to press it several times before it exit.
    Hello,

    normal as per how it is coded inside a loop ‼ So appears only one time if obviously outside at least …

  14. #14
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Search individually on each column

    Can the macro remove the loops to all the sheetsso that it can work for Sheet1 only? Then I can use the messages box

    Thanks

  15. #15
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Search individually on each column

    Hi
    Please modify the code with just work with Sheet1.
    Thank you

    Please Login or Register  to view this content.

  16. #16
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,862

    Re: Search individually on each column

    Try:
    Please Login or Register  to view this content.

  17. #17
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Search individually on each column

    Morning Mumps1

    Yay! Ok.. i will try when I get to work.

    I wanted to say that your version is actually best. Because the way you added the selection to enter the columns.

    So this will work in only Sheet1?
    Because the old code version, When I click the button to filter and it filter the other sheets as well.

    I really appreciate your effort on this.

    Thank you and I let you know how it goes as soon as I try the new version.

    Have a good day!

  18. #18
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Search individually on each column

    Hello,

    It works but there is a little issue.
    Last edited by RJ1969; 03-13-2023 at 01:45 PM.

  19. #19
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Search individually on each column

    The issue is that in my original worksheet had a skip row which I do need for other reason.

    Let say the filter is set in A2 and there A3 skip row.
    My Entries started in A4.

    the codes work perfectly but I realized that I have a skip row.

    Please fix and just tell me what need to change from the code.
    I attached the current sample worksheet.

    Thank you Mumps1.... so far so good!
    I appreciate you so much.
    Attached Files Attached Files

  20. #20
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Search individually on each column

    Pls let me know what did you add in the code so I can adjust it on my own next time.



    Thanks

  21. #21
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Search individually on each column

    Hi Mumps1

    I figured it out. There is no actually problem having the skip row or adjusting anything with the code you provided.

    Thank you so much for the all the time and effort.

  22. #22
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,862

    Re: Search individually on each column

    You are very welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Searching Function - how to search every word individually inside a cell?
    By niktodorov1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-03-2018, 05:05 AM
  2. Search Function - searching each word in each cell individually?
    By niktodorov1 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-01-2018, 11:20 PM
  3. PivotTable to show average of all months in one column (not individually)
    By saudi_red_neck in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 09-01-2014, 07:12 AM
  4. [SOLVED] Sort ascending each column (individually)
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-17-2013, 10:39 PM
  5. Replies: 1
    Last Post: 07-26-2011, 06:48 AM
  6. macro to sum each range individually within a single column
    By jferguson in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-16-2010, 12:56 PM
  7. [SOLVED] identifying a chart column individually in code
    By papa jonah in forum Excel General
    Replies: 3
    Last Post: 03-22-2005, 07:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1