+ Reply to Thread
Results 1 to 6 of 6

Take apart of the cell based on a special character

  1. #1
    Registered User
    Join Date
    12-17-2020
    Location
    Canada
    MS-Off Ver
    2019
    Posts
    26

    Take apart of the cell based on a special character

    Hello,

    I was hoping to find out how to pull the value left of the right-most "dash ( - )". For example the list has 100-A123-00. I would like it to pull a picture from a specified folder that has 100-A123 in it. The issue I am running into is that the folder with picture will have multiple values to chose from OR the picture is labeled 100-A123-01_A and will not pull any pictures as a result.

    Example

    A1000-01 is what the original value in the spreadsheet is (attached). In the picture folder I have A1000-01, A1000-02 etc. It doesn't matter which one it pulls to me, I just need one of the two but I need it to pull a generalized A1000 and not anything after the "-" because of certain numbers having multiple dashes and or the number conventions not perfectly matching the pictures.

    Example

    600-1234-01 is what the original value in the spreadsheet is. I would like it to grab any picture that has 600-1234 in it. Before it would grab it based on the entire name but alot of the pictures are named 600-1234-01_A or _B etc.

    Any help would be great thanks.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    07-14-2017
    Location
    Poland
    MS-Off Ver
    Office 2010
    Posts
    528

    Re: Take apart of the cell based on a special character

    If I understand you correctly, please test my code.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Best Regards,
    Maras.

  3. #3
    Registered User
    Join Date
    12-17-2020
    Location
    Canada
    MS-Off Ver
    2019
    Posts
    26

    Re: Take apart of the cell based on a special character

    This is making sense but it is still taking A1000-01 as a whole and not A1000.

    The main issue was actually pulling the picture. Unless it is the exact name in the folder it doesn't pull for me.

  4. #4
    Valued Forum Contributor
    Join Date
    07-14-2017
    Location
    Poland
    MS-Off Ver
    Office 2010
    Posts
    528

    Re: Take apart of the cell based on a special character

    Ok, I think this does what you want.
    Replace the code with this one.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-17-2020
    Location
    Canada
    MS-Off Ver
    2019
    Posts
    26

    Re: Take apart of the cell based on a special character

    Yes exactly,

    How would you pull a picture from a folder that contains the value you just retrieved?

    The issue I was having was that there are multiple options that it could be.

    Example: What you pulled = A1000

    The Picture naming conventions = A1000-01, A1000-02_A etc

    It doesn't matter whether the picture is -01 or -02.

  6. #6
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: Take apart of the cell based on a special character

    Quote Originally Posted by maras_mak View Post
    Please Login or Register  to view this content.
    For those who might be interested, here is more compact macro that will also do what the above code does without using Regular Expressions...
    Please Login or Register  to view this content.

+ 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] Excel Formula to Get the Middle data based on Special Character (Reverse Mid Function)
    By arnel_10 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-12-2017, 07:03 PM
  2. Need to highlight special character and the cells contains special character
    By dhilipan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-26-2013, 01:36 AM
  3. [SOLVED] Formulas to pull info based on certain special character
    By BROOF in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-11-2013, 09:04 AM
  4. Special Character for newline in a cell value
    By piyushdeora in forum Excel General
    Replies: 7
    Last Post: 02-24-2011, 07:23 AM
  5. Validated cell for special character
    By wlpeterson in forum Excel General
    Replies: 2
    Last Post: 05-26-2010, 01:19 PM
  6. Truncate field based on special character (*)
    By adgjqetuo in forum Access Tables & Databases
    Replies: 1
    Last Post: 04-27-2010, 04:46 PM
  7. Allow only one special character i a cell
    By Zadig Galbaras in forum Excel General
    Replies: 3
    Last Post: 02-03-2006, 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