+ Reply to Thread
Results 1 to 3 of 3

macro to number occurrences of a specific text string in a column

  1. #1
    Registered User
    Join Date
    12-09-2017
    Location
    Ohio
    MS-Off Ver
    Excel 2013 (home/student)
    Posts
    60

    macro to number occurrences of a specific text string in a column

    I have a task that I would like to automate with a macro. It is illustrated in the attachment. Column A shows BEFORE. In this example, the cells contain text strings. In the adjacent blank column I would like to enumerate each occurrence of "father" consecutively, starting with 1. The hoped-for output is shown in columns CD. An alternative version of the output is shown in column E (in place of D). Either one is equally good for me.

    The macro should ask for the string to be enumerated, as this will not always be the same string when I work on different sheets. The input for the macro will be selected cells (always from a single column).

    Thanks in advance for help.

    Russ
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: macro to number occurrences of a specific text string in a column

    e2 = Countif($C$2:$C2,$C$2) and drag down.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    12-09-2017
    Location
    Ohio
    MS-Off Ver
    Excel 2013 (home/student)
    Posts
    60

    Re: macro to number occurrences of a specific text string in a column

    Worked like a charm, thank you! I will mark this thread 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. Search and replace specific text avoiding occurrences as sub=string
    By paulwenman in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-25-2019, 06:53 PM
  2. How to Increment a Alphanumeric String on Number of occurrences in Column
    By USFengBULLS in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2019, 04:04 PM
  3. [SOLVED] VBA Macro to find text string in one column and replace specific text in another column if
    By bmahfood in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-21-2017, 11:15 AM
  4. [SOLVED] Counting the number of occurrences of specific text in a column
    By oneeasygeezer in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-23-2015, 11:11 AM
  5. [SOLVED] Use Countif and ?? to count occurrences of text string in a column
    By CWatsonJr in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-23-2014, 03:08 PM
  6. Formula to Count the Number of Occurrences of a Text String in a Range
    By poug1903 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-10-2011, 06:49 AM
  7. Replies: 1
    Last Post: 09-18-2009, 04:15 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