Closed Thread
Results 1 to 2 of 2

Finding two sub-strings within a string

  1. #1
    Registered User
    Join Date
    04-24-2012
    Location
    San Francisco, USA
    MS-Off Ver
    Excel 2007
    Posts
    60

    Finding two sub-strings within a string

    Hi Guys

    I have the following code:

    For j = 2 To Gfr

    If (InStr(1, Cells(j, 7), wordA, vbTextCompare) & InStr(1, Cells(j, 7), wordB, vbTextCompare)) Then
    Cells(j, 7).Copy
    Cells(i, 2).Select
    ActiveSheet.Paste
    Exit For
    End If
    Next j

    For some reason the instr functions dont seem to be working correctly. Are they correctly coded?

    many thanks

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Finding two sub-strings within a string

    Welcome to the Forum, unfortunately:

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    Thread Closed.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Finding two sub-strings within a string
    By pablowilks in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-26-2015, 03:05 PM
  2. how to Get all Strings Except last string in comma sepated string
    By narasappaj in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-20-2014, 07:05 AM
  3. Replies: 9
    Last Post: 12-21-2012, 04:18 AM
  4. Replies: 6
    Last Post: 03-08-2012, 10:35 AM
  5. Finding Start Position of string in list of strings
    By longfisher in forum Excel General
    Replies: 5
    Last Post: 05-25-2007, 10:34 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