Results 1 to 6 of 6
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    STRING FORM TXT FILE... (2000 sr 1)

    I take this tring 45-408258/F with this line:

    var_cope = Mid(riga, 1, 11)

    and put it in a cell

    after with a macro i delete the "-" and "/" and in the final result i have this 45408258F

    is possible to change the line var_cope = Mid(riga, 1, 11) to take directly the string the import of text witout "-" and "/".

    Naturally in text mode.

    Tks.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: STRING FORM TXT FILE... (2000 sr 1)

    var_cope = Mid(riga, 1, 11)
    var_cope = Replace(var_cope, "-", "")
    var_cope = Replace(var_cope, "/", "")

  3. #3
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: STRING FORM TXT FILE... (2000 sr 1)

    Try this:
    var_cope =CONCATENATE(LEFT(MID(riga,1,11),2),MID(MID(riga,1 ,11),4,6),RIGHT(MID(riga,1,11),1))
    Regards,
    Rudi

  4. #4
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: STRING FORM TXT FILE... (2000 sr 1)

    Tks, Rudi,

    but this is sthe same:

    var_cope = Left(Mid(riga, 1, 11), 2) & Mid(Mid(riga, 1, 11), 4, 6) & Right(Mid(riga, 1, 11), 1)

  5. #5
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: STRING FORM TXT FILE... (2000 sr 1)

    Absolutely. Is your question solved though?
    Hans's suggestion should work well too...lot shorter and easier to maintain!
    Regards,
    Rudi

  6. #6
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: STRING FORM TXT FILE... (2000 sr 1)

    OK! QUESTION SOLVED....
    Tks to you, and tks Hans naturally.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •