+ Reply to Thread
Results 1 to 3 of 3

Find indexnumber of substring in string

  1. #1
    Forum Contributor
    Join Date
    02-27-2020
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    447

    Find indexnumber of substring in string

    Hi,

    I would like to have a macro that searches the index number of "test" in a cell A2. For example if the string in cell A2 is 111test11 than B2 should display 4. How can i do this?

    I made this function but it doesn't work:
    Please Login or Register  to view this content.
    Any input is much appreciated!

  2. #2
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,713

    Re: Find indexnumber of substring in string

    What's happening ? Are you getting any error ? I tried your code & it's working fine

    Edit : If you're using a loop "For each c in range" then you're referencing cell A2 always ...
    Last edited by nankw83; 03-19-2021 at 02:50 AM.

  3. #3
    Forum Contributor
    Join Date
    02-27-2020
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    447

    Re: Find indexnumber of substring in string

    Thanks it works

+ 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. [SOLVED] ForLoop to Find string value as part of substring in another cell
    By skydivetom in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-08-2021, 05:19 PM
  2. [SOLVED] Find substring in range and categorise cells in range based on substring found
    By Stavrosis in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-15-2020, 11:50 AM
  3. Replies: 8
    Last Post: 03-09-2018, 11:39 AM
  4. Replies: 4
    Last Post: 02-22-2015, 09:52 AM
  5. [SOLVED] Find substring within a string, from a list
    By NotSwank in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-06-2014, 10:27 AM
  6. [SOLVED] Find the position of a substring in a string
    By nemo66ro in forum Excel General
    Replies: 6
    Last Post: 10-22-2012, 01:21 AM
  7. Find the sub string in column and copy the cell next to the substring
    By shrujan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-16-2009, 11:00 AM

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