Results 1 to 7 of 7

Concatenate formula

Threaded View

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

    Concatenate formula

    Hi,
    I try change code numbers like the follow one
    0101010100
    in this
    01-01-01-01-00
    and I know that with this formula
    =(CONCATENATE(LEFT(A2;2);"-";MID(A2;3;2);"-";MID(A2;5;2);"-";MID(A2;7;2);"-";RIGHT(A2;2)))
    I can work it out.
    So I create the following code
    Dim R As Long
    R = 2
        Do Until Trim(Cells(R, 1)) = ""
            If Len(Cells(R, 1)) = 10 Then
            Cells(R, 1).Offset(0, 2).Formula = "=(CONCATENATE(LEFT(A" & R & ";2);""-"";MID(A" & R & ";3;2);""-"";MID(A" & R & ";5;2);""-"";MID(A" & R & ";7;2);""-"";RIGHT(A" & R & ";2)))"
            ElseIf Len(Cells(R, 1)) = 8 Then
            Cells(R, 1).Offset(0, 2).Formula = "=(CONCATENATE(LEFT(A" & R & ";2);""-"";MID(A" & R & ";3;2);""-"";MID(A" & R & ";5;2);""-"";RIGHT(A" & R & ";2)))"
            Else
            Cells(R, 1).Offset(0, 2).Value = "TTTTTT"
        End If
        R = R + 1
        Loop
    but doenst work.
    Can somebody help me.
    Thanks in advance
    Last edited by Jokacave; 01-31-2009 at 09:57 AM.

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