Results 1 to 19 of 19

instr function if loop to find data

Threaded View

  1. #1
    Forum Contributor
    Join Date
    12-20-2019
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    116

    instr function if loop to find data

    I have cells with a string which looks like

    11.25X2.5X11 abcd efgh hot (1000B)
    11 X2 X10 hot qwerty poiuy (2000B)
    10X2,5X11,25 ghjk hot lkjh (2000B)

    The above strings are in column f2, f3 and f4 and so on

    I want to have an if loop which can look for within f2:f25000
    for string which have three "X" in the cell and the word/string HOT, because that seems like the only filtering criteria that would work (because of inconsistent spaces before and after X imo).

    I am trying to use :
    For Each cell In Range("F2:F25000")
          If Instr(cell.value, "hot")>0 Then 
             If Instr(cell.value, "X")>0 Then
         cell.offset(0, 4).Value = "BOX"
    NEXT cell
    How can I modify this for it to do what I want, or some other better way of doing it?
    Any suggestions.
    Last edited by diyVBA; 03-02-2020 at 04:22 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Does not cosistantly find a text string using "InStr" function
    By Bobbbo in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 03-21-2016, 08:37 PM
  2. Using Find or some other InStr like function with an if and formula.
    By Hyflex in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-02-2015, 11:15 AM
  3. [SOLVED] Find function in nested loop breaking down - not on first time through loop
    By adamstarr12 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-14-2014, 09:32 AM
  4. Find function in nested loop breaking down - not on first time through loop
    By adamstarr12 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-07-2014, 04:59 PM
  5. InStr function doesn't find specific text, but finds any text in column and runs code
    By mikey3580 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-27-2014, 03:50 AM
  6. [SOLVED] If Instr - find last row of data above and delete everything in between
    By twckfa16 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-24-2013, 03:54 PM
  7. For Exit Loop in instr function
    By drcheaud in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2011, 03:24 PM

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