Results 1 to 7 of 7

Excel Formula or VBA to find cell contains a certain text

This is a discussion on Excel Formula or VBA to find cell contains a certain text within the Excel Questions forums, part of the Question Forums category; Hi Folks, Let's say I have these words in Column A (A1:A4) Green Apple Red Apple Yellow Banana Cute Green ...

  1. #1
    New Member
    Join Date
    Oct 2008
    Posts
    41

    Question Excel Formula or VBA to find cell contains a certain text

    Hi Folks,

    Let's say I have these words in Column A (A1:A4)
    Green Apple
    Red Apple
    Yellow Banana Cute
    Green Banana

    How is the code or formula be written if I want to get Apple & Banana return in B1:B4?
    B1 = Apple
    B2 = Apple
    B3 = Banana
    B4 = Banana

    Thanks so much

  2. #2
    Board Regular
    Join Date
    Nov 2011
    Posts
    106

    Default Re: Excel Formula or VBA to find cell contains a certain text

    Are Apple and Banana going to be your only choices and will they ever both occur? Will there be times where neither occur?

  3. #3
    New Member
    Join Date
    Oct 2008
    Posts
    41

    Default Re: Excel Formula or VBA to find cell contains a certain text

    Dear Murrayty,

    This is the fact, I have more than 7 criteria to find in column O (15), they are :
    Partial
    Surplus
    Discrepancy
    Waiting Memo
    Waiting Physical
    Inventory On Progress
    Prepare Physical Summary

    Thanks

  4. #4
    Board Regular
    Join Date
    Nov 2011
    Posts
    106

    Default Re: Excel Formula or VBA to find cell contains a certain text

    And they will be showing up along with other miscellaneous text in the same cell?

  5. #5
    New Member
    Join Date
    Oct 2008
    Posts
    41

    Default Re: Excel Formula or VBA to find cell contains a certain text

    Dear Murrayty,

    These are the actual sentences in the column
    - Partial Close Out (desired return = Partial)
    - Waiting Memo Close Out (desired return = Waiting Memo)
    - Material Surplus (desired return = Material Surplus)
    - Material Surplus & Outstanding Warehouse (desired return = Material Surplus)
    - Discrepancy between material installed (desired return = Discrepancy)
    - Prepare Discrepancy (desired return = Discrepancy)
    - Waiting Physical Inventory (desired return = Waiting Physical)
    - Prepare Summary (desired return = Prepare Summary)

    Thank you

  6. #6
    Board Regular
    Join Date
    Nov 2011
    Posts
    106

    Default Re: Excel Formula or VBA to find cell contains a certain text

    I would just make a lookup table on another sheet and call to it.

    =VLOOKUP(A1,Sheet2!$A$1:$B$8,2,FALSE)

    A1 = The cell you want to lookup

    Sheet2 A1:B8 =

    Code:
    Discrepancy between material installed	        Discrepancy
    Material Surplus	                        Material Surplus
    Material Surplus & Outstanding Warehouse	Material Surplus
    Partial Close Out	                        Partial
    Prepare Discrepancy	                        Discrepancy
    Prepare Summary	                                Prepare Summary
    Waiting Memo Close Out	                        Waiting Memo
    Waiting Physical Inventory	                Waiting Physical
    It might be possible to write a formula to do it but I am not having any luck myself.

  7. #7
    New Member
    Join Date
    Oct 2008
    Posts
    41

    Default Re: Excel Formula or VBA to find cell contains a certain text

    Dear Murrayty,

    Thanks for your time. I will take the option if I can't get another formula or VBA code.

    Again. thank you very much

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com