+ Reply to Thread
Results 1 to 10 of 10

Need to remove the first 2 characters in string plus spaces on the left with macro

  1. #1
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Need to remove the first 2 characters in string plus spaces on the left with macro

    Hi I need help to remove the first 2 characters in string in column A.
    I need a macro for it because its part of bigger sort.
    The 2 first characters and also if it can remove spaces in the left in the text it will be great.

    Below is a text string. To put in cell A2. Please have a look I need a macro for it.

    Here is an example of the string with spaces also

    Please have a look

    Sincerely
    Abjac



    Please Login or Register  to view this content.
    Wanted result will be

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Need to remove the first 2 characters in string plus spaces on the left with macro


    Hi,

    you can combine Mid function from character #3 with LTrim function

    or using Mid function only if needed string starts always from same position …

  3. #3
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Need to remove the first 2 characters in string plus spaces on the left with macro

    Hi MArc and thanks. Could you show how it will look in a macro please.

    Thanks in advance

    Abjac

  4. #4
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Need to remove the first 2 characters in string plus spaces on the left with macro

    HI Is it possible to do this with a macro or shall or do i need to use formula. Macro would be best because its part of much sorting.

    Sincerely
    Abjac

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Need to remove the first 2 characters in string plus spaces on the left with macro


    These functions are in VBA inner help, very beginner level …

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Need to remove the first 2 characters in string plus spaces on the left with macro

    Maybe:

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Need to remove the first 2 characters in string plus spaces on the left with macro

    Hi John and thanks for the answer. I works great really just as it have to do. How to put a range on it ?, or to last used cell in column A?
    Thanks

    Sincerely

    Abjac

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Need to remove the first 2 characters in string plus spaces on the left with macro

    Maybe:

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Need to remove the first 2 characters in string plus spaces on the left with macro

    Hi John. It works just brilliant. Thanks allot for you help. Its really great.

    Have a nice evening

    Sincerely'
    Abjac

  10. #10
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Need to remove the first 2 characters in string plus spaces on the left with macro

    You're welcome. Glad to help out and thanks for the feedback.

+ 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. remove spaces and characters in hyperlink - macro
    By missy22 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2013, 09:23 AM
  2. Replies: 8
    Last Post: 12-17-2012, 05:30 AM
  3. [SOLVED] remove spaces (special characters) after numbers
    By fareastwarriors in forum Excel General
    Replies: 13
    Last Post: 11-04-2012, 09:25 PM
  4. [SOLVED] Extract left characters from string with exception of 2 right characters
    By sweetkel23 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-16-2012, 10:45 PM
  5. [SOLVED] Remove All Text,Special Characters, & Spaces
    By g48dd in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-01-2011, 09:24 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