+ Reply to Thread
Results 1 to 7 of 7

How to add a text in to a sell after specific length

  1. #1
    Registered User
    Join Date
    07-30-2019
    Location
    India
    MS-Off Ver
    2010
    Posts
    9

    How to add a text in to a sell after specific length

    Hello All

    How can we add text in to a cell after specific length?So that the added text looks in a straight line.
    For example
    I want to add a text "ST0" after my string
    If I use CONCATENATE then it will look like;

    E_Stop ActiveST0
    GuardDoor OpenST0

    but actually I want the cell to be look like the added text in a straight line as attached;


    Regards
    Anoop
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,777

    Re: How to add a text in to a sell after specific length

    You can do it without VBA.

    Custom cell formatting: @* "ST0"
    Attached Files Attached Files
    Last edited by AliGW; 07-17-2020 at 03:24 AM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    07-30-2019
    Location
    India
    MS-Off Ver
    2010
    Posts
    9

    Re: How to add a text in to a sell after specific length

    Hello AliGW

    Thanks for the Answer.
    But what if My "ST0" will change to "ST1" or "MT1" depends on the text behind which is not constant

    Regards
    Anoop

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,777

    Re: How to add a text in to a sell after specific length

    I don't know.

    I want to add a text "ST0" after my string
    That wasn't in the original brief, was it?

    I learnt something about custom cell formatting today: hopefully you will have learnt something about making your requirements clear.
    Last edited by AliGW; 07-17-2020 at 04:05 AM.

  5. #5
    Registered User
    Join Date
    07-30-2019
    Location
    India
    MS-Off Ver
    2010
    Posts
    9

    Re: How to add a text in to a sell after specific length

    Yes.My mistake.
    Last edited by AliGW; 07-17-2020 at 04:05 AM. Reason: Please don't quote unnecessarily!

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: How to add a text in to a sell after specific length

    You will not be able to align the text exactly if you are using a proportional font.

    What you would do is add spaces in order to pad the area between left and right text, but unless the font is monospaced the alignment would require different amount of padding for the same gap size based on the left side characters.

    i.e. left hand side is 5 characters and the padding is 5 characters, where - represents a space
    proportional font
    WWWWW-----ST0
    IIIII-----ST0

    proportional font different amount of padding
    WWWWW-----ST0
    IIIII-----------ST0


    Fixed width font
    WWWWW-----ST0
    IIIII-----ST0
    Cheers
    Andy
    www.andypope.info

  7. #7
    Registered User
    Join Date
    07-30-2019
    Location
    India
    MS-Off Ver
    2010
    Posts
    9

    Re: How to add a text in to a sell after specific length

    Hello Andy

    I got your point.
    Thanks for the feedback.

    I learnt a new thing today

+ 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. Count words with a specific length
    By glda19 in forum Excel General
    Replies: 7
    Last Post: 11-28-2016, 05:52 PM
  2. [SOLVED] All possible numbers for specific length
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 27
    Last Post: 03-25-2016, 11:58 PM
  3. Replies: 4
    Last Post: 08-13-2014, 11:03 PM
  4. [SOLVED] Pulling specific TEXT out of a string of varying length
    By Lasloja in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-28-2012, 05:26 PM
  5. Replies: 6
    Last Post: 03-08-2012, 10:35 AM
  6. Searching value of specific length
    By Marco-Kun in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 12-06-2011, 11:23 AM
  7. Replies: 1
    Last Post: 04-17-2005, 08:10 PM

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