+ Reply to Thread
Results 1 to 6 of 6

Vba to Return the Term located between first two Dashes

  1. #1
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Question Vba to Return the Term located between first two Dashes

    Hi Everyone,

    I'm using the following code to add cell values to a worksheet based on the value from another.

    My problem is that I do not wish for it to grab the entire cell value. I only want it to take the value found between the first dash to the second dash.

    I would also like to be able to use this code in other situations. i.e. take the value found from the second dash to the third. So having a selection for me to assign the number of dashes would be great!

    Please Login or Register  to view this content.
    A typical value that would be found in cell (j,3) is Microsoft-Jordan-Excel Forum

    Having a way to identify just "Jordan" from the term above would be great!

    Thanks Heaps in advance
    Last edited by jordan2322; 08-13-2012 at 09:45 PM.

  2. #2
    Forum Contributor
    Join Date
    11-26-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    159

    Re: locate Term located between two '-'

    hi use this function. let data in A1, and formula in B1 and apply this to VBA CODE
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Re: locate Term located between two '-'

    Thank you for your quick reply mmmarks.

    Is there a way to do this using VBA not excel sheet functions?

    Regards

  4. #4
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Re: locate Term located between two '-'

    Any ideas on this one?

  5. #5
    Forum Contributor
    Join Date
    11-26-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    159

    Re: Vba to Return the Term located between first two Dashes

    Hi Jordan , sorry for delay , Here is piece of cod. Hope It may suite for your requirment.
    Let say data in A1 .

    Please Login or Register  to view this content.
    Thanks

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Vba to Return the Term located between first two Dashes

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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