+ Reply to Thread
Results 1 to 4 of 4

Parse Cell for Unknown Words and Assign to Variable

  1. #1
    Forum Contributor
    Join Date
    09-13-2012
    Location
    Midwest
    MS-Off Ver
    Excel 365
    Posts
    124

    Parse Cell for Unknown Words and Assign to Variable

    A cell receives input that can be any combination of "PRICE", "NO BOL", or other word(s).
    How do I search that cell for the other word(s) that is not "PRICE" or "NO BOL" and copy the other word(s) into a variable?
    I feel like there is a very simple function call that I havent found yet.
    Thanks.
    -Luke

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Parse Cell for Unknown Words and Assign to Variable

    This UDF should do the trick:-
    For Data in "A1" enter function as:- =nfil(A1)

    Please Login or Register  to view this content.
    To Save and Run UDF:-
    Copy Function from Thread
    In Your Data sheet , Click "Alt+F11",:- Vb Window appears.
    From the VBWindow toolbar, Click "Insert" ,"Module":- New VBwindow appears .
    Paste Code into this window.
    Close Vbwindow.

    In sheet, Add the "function" in a cell as :- =nfil(A1)
    NB:- Once you've added the first bracket you can select the range from the sheet
    Then click "Enter"
    The cell should now show the result.
    Regards Mick
    Last edited by MickG; 08-07-2019 at 12:53 PM.

  3. #3
    Forum Contributor
    Join Date
    09-13-2012
    Location
    Midwest
    MS-Off Ver
    Excel 365
    Posts
    124

    Re: Parse Cell for Unknown Words and Assign to Variable

    I'm actually calling it from a userform, but it works great! I can adapt that to clean up a bunch of other code I have. Thanks!

  4. #4
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Parse Cell for Unknown Words and Assign to Variable

    You're 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. Assign Variable to Cell
    By ionelz in forum Excel General
    Replies: 2
    Last Post: 02-09-2019, 05:04 PM
  2. [SOLVED] Assign Cell value to a variable
    By Pergo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-18-2015, 03:08 PM
  3. Replies: 15
    Last Post: 10-12-2014, 08:53 AM
  4. [SOLVED] Parse out Last Two Words in a Cell
    By dash11 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-06-2014, 03:41 PM
  5. Macro find unknown words and mark containing cell
    By forfiett in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-14-2012, 04:58 PM
  6. Replies: 2
    Last Post: 07-24-2012, 11:47 AM
  7. [SOLVED] How do I assign the value in a cell to a variable?
    By JasonK in forum Excel General
    Replies: 8
    Last Post: 06-07-2006, 06:25 PM

Tags for this Thread

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