+ Reply to Thread
Results 1 to 10 of 10

Find First Instance of Text String in Column

  1. #1
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Find First Instance of Text String in Column

    I want to first the first instance of either 0: or 1: or 2: or 3: in Column A only on Sheet2 and once found copy the cell to Sheet3 D3. These strings can be contained anywhere within a word in Col A.
    Last edited by ScabbyDog; 02-02-2016 at 05:39 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,424

    Re: Find First Instance of Text String in Column

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Find First Instance of Text String in Column

    Quote Originally Posted by TMS View Post
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Regards, TMS
    Thanks but I need VBA code. Needs to find the first instance of either 0: or 1: or 2: or 3:
    Whatever comes first.

  4. #4
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Find First Instance of Text String in Column

    Will it be something like this? This runs without error but nothing actually copies and pastes despite cell A40 on sheet2 containing the text "14:00:00"

    Please Login or Register  to view this content.
    Last edited by ScabbyDog; 02-02-2016 at 07:27 AM.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,424

    Re: Find First Instance of Text String in Column

    14:00:00 will be seen as a time unless the cell is formatted as text. And, if it is a time, it will be a numeric value less than 1 as a time is represented as a fraction of a day. That is 12 pm will be 0.5.

    Maybe test .Text rather than .Value:

    Please Login or Register  to view this content.

    Regards, TMS

  6. #6
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Find First Instance of Text String in Column

    Ah yes, that'd be it! Solved! Thanks all.

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Find First Instance of Text String in Column

    Try
    Please Login or Register  to view this content.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,424

    Re: Find First Instance of Text String in Column

    Jindon's code with some embellishments ...

    Please Login or Register  to view this content.

    Regards, TMS

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,424

    Re: Find First Instance of Text String in Column

    Thanks for the rep

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Find First Instance of Text String in Column

    ScabbyDog,

    You should be very careful when you use Text property.
    If the cell width is not wide enough and looks like ####### then it will fail to pick up.

+ 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. Replies: 4
    Last Post: 03-30-2015, 03:20 PM
  2. [SOLVED] Lookup Table to Find/Replace Every Instance of a String (2/2)
    By Baghel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-04-2013, 05:49 AM
  3. Replies: 12
    Last Post: 12-31-2012, 04:13 AM
  4. [SOLVED] Find first and last instance of text in column range multiple times
    By ShannonHowell in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-24-2012, 11:52 AM
  5. Find nth instance of a character in a string
    By BRISBANEBOB in forum Excel General
    Replies: 1
    Last Post: 12-26-2011, 07:09 PM
  6. Finding the second instance of a value after a text string
    By ryantaylor in forum Excel General
    Replies: 9
    Last Post: 03-02-2011, 11:18 AM
  7. [SOLVED] Find nth instance of a character in a string
    By Francis Hayes (The Excel Addic in forum Excel General
    Replies: 7
    Last Post: 01-21-2005, 12:06 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