Results 1 to 5 of 5

Find common starting string in all rows in column

Threaded View

  1. #1
    Registered User
    Join Date
    03-24-2020
    Location
    Maryland
    MS-Off Ver
    365
    Posts
    7

    Find common starting string in all rows in column

    Hi everyone,

    I'm working on a VBA script, and part of it requires renaming potentially up to 40 names. The way the data is originally exported will be consistent between each row in any given dataset, but not between datasets. I am looking for a VBA code that will look at all strings in A1:A41, and return the starting common string.

    For example, dataset 1 may be
    A1: Demo a_b 2021.05.19 - Mark - Monday
    A2: Demo a_b 2021.05.19 - Jared - Tuesday
    A3: Demo a_b 2021.05.19 - Patty - Thursday
    A4 - A41 same pattern

    and dataset 2 may be
    A1: Demo a_b 2021.05.20 - Mark - Monday
    A2: Demo a_b 2021.05.20 - Jared - Tuesday
    A3: Demo a_b 2021.05.20 - Patty - Thursday
    A4 - A41 same pattern

    So as you can see, each time the data is analyzed, the first part is consistent within that dataset, but the second part changes. I am looking for a code that will search A1:A41 and return as much of the string from the left that matches every cell.

    The ultimate goal is the return a prompt which says "All of your samples start with XXX, would you like me to remove this from their names?"
    Attached Files Attached Files
    Last edited by stranula; 05-19-2021 at 04:55 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 09-11-2014, 10:59 AM
  2. Find most common (x5) numbers within numerical string range
    By JEWB in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 04-03-2014, 06:59 AM
  3. [SOLVED] Find Most Common Occurring String Based on Lookup Value
    By kolor in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-11-2013, 09:17 PM
  4. [SOLVED] Find out the length of common string between cells of two columns.
    By rampulaparthi in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 08-28-2013, 03:25 AM
  5. How to find common string column from two columns??
    By sanil.henry1982 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-14-2012, 08:34 AM
  6. [SOLVED] URGENT find common string values in 2 colums
    By M.Karim in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-13-2012, 11:21 AM
  7. Find the lest common string-value in a range
    By ElmerS in forum Excel General
    Replies: 4
    Last Post: 02-01-2009, 06:25 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