+ Reply to Thread
Results 1 to 4 of 4

Skip field if it doesn't meet FIND criteria

  1. #1
    Registered User
    Join Date
    08-25-2005
    Posts
    37

    Skip field if it doesn't meet FIND criteria

    I want a macro that reads a column to the end. If Col A contains a string, I want to put the contents of Col D into Col E. If it doesn't have that string, simply ignore it.

    All I have so far is this:
    =IF(ISNUMBER(FIND("xyzstring",A4,1)),C4,)

    but obviously this is going to set the field to zero, and I just wish it to be ignored.

    Then I want to put this into a loop that goes through all records.

    Any help is appreciated.

    Paul

  2. #2
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Skip field if it doesn't meet FIND criteria

    You can use something like this to get you started. This simple formula searches the column for a string and returns a count of times found.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Use the above like =if(COUNTIF(A:A,"*xyzstring*")>0, Do this if true, Do this if false)
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  3. #3
    Registered User
    Join Date
    08-25-2005
    Posts
    37

    Re: Skip field if it doesn't meet FIND criteria

    So what do I do in case of False, that is Skip.

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Skip field if it doesn't meet FIND criteria

    According to my book on VBA.....I don't yet know VBA but am going to try and learn it.

    The general structure is as follows. The TRUE and FALSE parts are separated in a Sub routine with the appropriate definitions to start and end the Sub.

    If something = "" Then Exit Sub
    If something >0 Then.....

    Hope this helps.

+ 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. IF formula - Skip rows that dont meet criteria
    By AusBec in forum Excel General
    Replies: 7
    Last Post: 09-03-2014, 09:52 PM
  2. Replies: 2
    Last Post: 02-12-2014, 11:14 PM
  3. Formula to skip a cell if it does not meet criteria
    By viciann in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-07-2013, 12:17 AM
  4. Replies: 0
    Last Post: 11-17-2010, 12:02 PM
  5. Counting even if doesn't meet criteria
    By Finn in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-23-2009, 03:14 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