+ Reply to Thread
Results 1 to 3 of 3

VBA version of left, mid, and right

  1. #1
    Registered User
    Join Date
    07-04-2009
    Location
    Cincinnati Ohio
    MS-Off Ver
    Excel 2003
    Posts
    1

    VBA version of left, mid, and right

    Is there a method using VBA to duplicate the Excel functions of left, mid, and right?

    I have variable length strings that have a '/' in them such as "0.5/9".

    I need to break them into two variables before and after the '/'.

    How can this be done using VBA?

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: VBA version of left, mid, and right

    KGH,

    Welcome to the Excel Forum.

    Try using Split

    See:
    http://www.excelforum.com/excel-prog...iple-rows.html


    Post your workbook (or sample) - scroll down and see "Manage Attachments".


    See the attached workbook "Split Text - KGH - SDG.xls" with macro "SplitText".

    Then run the "SplitText" macro.
    Attached Files Attached Files
    Last edited by stanleydgromjr; 07-04-2009 at 10:36 AM.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

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

    Re: VBA version of left, mid, and right

    Stanley's use of Split would be the way to approach this problem, but you should also be aware that VBA has the string functions Left, Right and Mid.
    _
    ...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