Results 1 to 7 of 7

Function SpliText in a macro

Threaded View

  1. #1
    Forum Contributor
    Join Date
    12-19-2006
    Posts
    113

    Function SpliText in a macro

    Two months ago, DonkeyOte help me (http://www.excelforum.com/excel-prog...e-formula.html) solve a problem, with this function:
    Function SplitText(rngData As Range, bChars As Byte, strDelim As String) As String
    Dim b_i As Byte
    For b_i = 0 To (Application.RoundUp((Len(rngData.Value) / bChars), 0) - 1) Step 1
        SplitText = SplitText & strDelim & Mid(rngData.Value, (b_i * bChars) + 1, bChars)
    Next b_i
    SplitText = Replace(SplitText, strDelim, "", 1, 1)
    End Function
    At that moment, everything works perfect because what I want is transform code numbers like this one
    0101010100
    into this
    01-01-01-01-00
    but suddenly start having different kind of code numbers like those
    5010301 ( ....which I want transform in this....: 05-01-03-01 )
    101050100 ( ....which I want transform in this....: 01-01-05-01-00 )
    0101010100 ( ....which I want transform in this....: 01-01-01-01-00 )
    02-02-04-00 ( ....which I want transform in this....: 02-02-04-00 )
    01.10.01.05.00 ( ....which I want transform in this....: 01-10-01-05-00 )

    Can somebody help me.
    Thanks in advance

    I attached the files which I.m using
    *I open the "testnew1" with the "Action"
    Attached Files Attached Files
    Last edited by Jokacave; 03-31-2009 at 01:40 PM.

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