+ Reply to Thread
Results 1 to 5 of 5

Text macro not working properly

  1. #1
    Forum Contributor
    Join Date
    08-01-2007
    Posts
    110

    Text macro not working properly

    Hi there Everyone! I have a small problem with an easy macro.
    The problem is the following. I have a code number (L256) and when I run the macro I would like to get the nex code in line (which in this case is: L257). The macro I wrote works fine the problem is that it puts a space between the "L" letter and the number so it looks like (L 257, and it should be L257). Why is that happening?? Please find attached the file with the macro.

    Thank you in advance for your help!

  2. #2
    Forum Contributor
    Join Date
    08-01-2007
    Posts
    110
    Sorry, I forget to add the file. Here it is..please find attached.
    Attached Files Attached Files

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    Hi

    You don't need to use the Str function (the leading space is reserved for the sign of the number, blank if positive).

    You could alternatively use something like:

    Please Login or Register  to view this content.
    Richard

  5. #5
    Forum Contributor
    Join Date
    08-01-2007
    Posts
    110
    ) Thanx a lot guys!!! It's working! ) Thank you, thank you, thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. trim macro not working properly on large file
    By bernie1961 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-10-2008, 09:38 AM
  2. Text Box name changing, macro to delete not working
    By NMullis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2008, 05:43 PM
  3. Problem importing text file using macro
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-01-2007, 10:21 PM
  4. text to numbers via a macro
    By stevekirk in forum Excel General
    Replies: 1
    Last Post: 09-20-2007, 12:32 PM
  5. macro to delete all text after colons
    By Orzabal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-27-2007, 10:22 AM

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