+ Reply to Thread
Results 1 to 6 of 6

how to find all positions of string in a string ?

  1. #1
    Registered User
    Join Date
    06-15-2023
    Location
    Israel
    MS-Off Ver
    2019
    Posts
    3

    Question how to find all positions of string in a string ?

    how to find all positions of string in a string ?

    I have two subroutines The First Find and count the number of Occurrences of searched string and after it calls to another
    subroutine that find the first position of the searched string and popup message box with the string before and after the founded string using mid

    for your convenience Here is the code

    Please Login or Register  to view this content.
    But How do I need to add / change the code for getting the other Occurrences


    Regards To all Answers
    Last edited by ihelpexcel4u; 07-05-2023 at 11:59 PM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: how to find all positions of string in a string ?

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: since you're new, I've done it for you, this time.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: how to find all positions of string in a string ?

    Is this a homework assignment?
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

  4. #4
    Registered User
    Join Date
    06-15-2023
    Location
    Israel
    MS-Off Ver
    2019
    Posts
    3

    Re: how to find all positions of string in a string ?

    thank you very much for undestanding me

  5. #5
    Registered User
    Join Date
    06-15-2023
    Location
    Israel
    MS-Off Ver
    2019
    Posts
    3

    Re: how to find all positions of string in a string ?

    No it's not a homework assignment.

    can you help me with it ?

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: how to find all positions of string in a string ?

    Please see the yellow banner on how to attach a sample worbook: it is much easier to produce a solution when we have data/expected results to work with.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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. String index positions
    By Unome in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-22-2017, 04:36 AM
  2. Extract numbers in different positions from a string
    By Catsonheat in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-20-2017, 10:07 AM
  3. VBA Find Partial String in String Array and Output the Found String Array Value
    By scherich in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2014, 11:20 AM
  4. [SOLVED] Vlookup, Match (Search or Find) partial string within string in a Cell
    By dluhut in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-28-2013, 12:40 PM
  5. find how many times a word appears in a string at certain positions within the string
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-05-2013, 12:05 AM
  6. [SOLVED] To extract certain string with specific positions (start/end)
    By meetvivek72 in forum Excel General
    Replies: 3
    Last Post: 08-21-2012, 12:11 PM
  7. Replies: 2
    Last Post: 07-15-2011, 04:11 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