+ Reply to Thread
Results 1 to 6 of 6

GURUS: Can't break out a certain piece of a string and put in another column (complicated)

  1. #1
    Forum Contributor
    Join Date
    09-23-2015
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    187

    GURUS: Can't break out a certain piece of a string and put in another column (complicated)

    Hi all,

    I am delaying with a report that gets generated through an MIS system on a monthly basis, in this report there is s afield called “Milestone Name” (Column AM) and sometimes embedded in this name is a MIS project number, but not always. In the Sample Workbook and I changed the text font to blue where the MIS project name is for the first few cases, so it’s easy to identify. The MIS project number will always follow a certain naming convention. If it’s there will always start with the number 3 or 4, followed by three other numbers, followed by a hyphen and another two numbers… so 3XXX-XX or 4XXX-XX. I don’t know if this is possible or not, but for the fields that do contain this MIS #, is there a way to get VBA to search it and extract it placing it in the next column. The workbook contains +10,000 rows so it would save me a lot of time if I had a macro doing this for me every month.

    As requested here is the Sample workbook I am dealing with Sample.xlsx

    Problem:
    Sometimes like in row 318 in the picture, the date contains a similar format (2015-08), naturally I would of used the find function to find ####-##, but the problem is how do I do this if the date looks similar, is there a way to get the code to reject anything starting with a 2015 and only copy numbers like 3XXX-XX or 4XXX-XX

    I need to firstly know if this is possible in VBA, if you don’t know how to write a code for it its okay but please give me your input if it’s possible or not. If impossible I can stop trying things. Any feedback is much appreciated, and if you’re a guru and think you can come up with something or set me on the right path, then hats off to you, you are a legend!
    Attached Images Attached Images

  2. #2
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: GURUS: Can't break out a certain piece of a string and put in another column (complica

    first things first, it should definitely be possible. i'm not certain exactly how, but regular expressions come to mind (i've never actually written anything w/ regular expressions, but saw someone else solve a problem kinda like this with them).

    i'm working on something a bit less elegant.
    Hope I could help - if your post has been solved don't forget to mark it as such.

    Clicking the * below is a great way to say thanks!

    "Drowning in 10 feet of water isn?t any different than drowning in a million feet. And if you can swim, it doesn?t matter how deep the ocean is. At some level, once you realize you?re in water that?s too deep to stand, you have to have a very different approach," - Joi Ito

  3. #3
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: GURUS: Can't break out a certain piece of a string and put in another column (complica

    this seems to be working on the sample data:
    Please Login or Register  to view this content.
    (borrowed heavily from here: http://www.mrexcel.com/forum/excel-q...character.html)

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: GURUS: Can't break out a certain piece of a string and put in another column (complica

    Here's another:

    Please Login or Register  to view this content.
    Last edited by xladept; 10-28-2015 at 05:38 PM.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  5. #5
    Forum Contributor
    Join Date
    09-23-2015
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    187

    Re: GURUS: Can't break out a certain piece of a string and put in another column (complica

    Code is working. Thank you you rock

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: GURUS: Can't break out a certain piece of a string and put in another column (complica

    You're welcome and thanks for the rep!

+ 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: 2
    Last Post: 10-28-2015, 04:10 PM
  2. How to display output from one locked data piece and one client-input data piece?
    By tnovak in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-07-2014, 12:48 PM
  3. [SOLVED] how to identify string and integer within one piece of data
    By jakeembx in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-02-2014, 12:29 PM
  4. [SOLVED] Break string into cell (Column)
    By itselflearn in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-02-2013, 12:43 PM
  5. Replies: 9
    Last Post: 11-12-2010, 05:51 AM
  6. Vertical Page Break / Column Break
    By kmg2424 in forum Excel General
    Replies: 0
    Last Post: 07-27-2010, 08:10 AM
  7. need to extract piece of string
    By als86 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-24-2009, 09:40 AM

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