+ Reply to Thread
Results 1 to 8 of 8

Indent Function

  1. #1
    Registered User
    Join Date
    10-25-2007
    Posts
    3

    Red face Indent Function

    Hello Folks,

    Why is there a function(formula) for Indenting text in Excel? I would like to convert certain text into different levels as per their deparment

    Finance
    John Smith
    Katie Curic

    Accounting
    Celina Woodpecker
    Masha Yukovic


    into

    Finance
    John Smith
    Katie Curic
    Accounting
    Celina Woodpecker
    Masha Yukovic
    Is it not possible to do it for multiple worksheets quickly? I would want to create a function that would

    =INDENT(A1,1) meaning indent once
    =INDENT(A2,2) meaning indent twice

    that will be great for my excel reports!!
    Please help!!!

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    Try this user defined function

    Please Login or Register  to view this content.
    It works best with a non-proportionate font such as Courier New.
    Martin

  3. #3
    Registered User
    Join Date
    10-25-2007
    Posts
    3

    Smile Wow

    This completely works!

    Thanks, mrice, really appreciate it!

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    Word of caution: Be careful if you later plan to manipulate, lookup or use numbers after using this macro. You'll need to TRIM or otherwise fix things because it's not a true indent, it's placing blank spaces before your text.

    ChemistB

  5. #5
    Registered User
    Join Date
    10-25-2007
    Posts
    3

    Thumbs up Trim

    I understand and thanks for the heads-up - This formula just helped me remove the CONCATENATE FORMULA
    =IF(C2="","",IF(L2=7,CONCATENATE(" SPACES ",C2),IF(L2=8,CONCATENATE(" MORE SPACES ",C2)


    so its not a long formula. I wonder why we can't create

    First Level
    Indent.Level 1

    Second Level
    Indent.Level 1
    Indent.Level 1

    or something with the code. I wonder why we don't have Indent Function the way Mrice created it =INDENT(A1,1), etc.. to begin with

  6. #6
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    I did try the use of chr$(9) instead of the spaces to insert a tab but this didn't appear to work.

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Trim

    Hi,

    I don't see the real problem here. Why not just use the

    Please Login or Register  to view this content.
    instruction in a macro, where n = a numeric variable that determines how many indent spaces you need and myrange is the cell/cells you're interested in.

    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

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