+ Reply to Thread
Results 1 to 3 of 3

VBA to indent and text alignment

  1. #1
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    VBA to indent and text alignment

    Hello,
    I have any issue after running the code to SUM(A1:A10) then place the numberical results
    in A12. Then also I have SUM(B1:B10) incell B12; SUM(C1:C10) in cell C12.

    The numbers came out at right alignment and no indent. I like to correct the indent
    using VBA instead of changing manually. The try the below code, it seems do not work.
    Is this a correct vode?

    Please Login or Register  to view this content.
    Please advise.

    Thanks
    Last edited by Rocky2013; 08-21-2013 at 08:31 PM.

  2. #2
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: VBA to indent and text alignment

    This will indent each of your summations (A12, B12, C12, etc.) extending right from A12 assuming no blanks.

    Please Login or Register  to view this content.
    Perhaps it was the Noid who should have avoided me...
    If you are satisfied with my solution click the small star icon on the left. Thanks
    1. Make a copy of your workbook and run the following code on your copy (just in case)
    2. With excel open, press ALT+F11 to open the Visual Basic Editor (VBE). From the "Insert" menu, select "Module".
    3. Paste the code from above into the empty white space. Close the VBE.
    4. From the developer tab, choose "Macros", select the Sub Name, and click "Run".

  3. #3
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    Re: VBA to indent and text alignment

    Hi,
    It works!! Thanks for the work.

+ 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. Replies: 3
    Last Post: 04-09-2020, 09:22 AM
  2. Conditional Formatting, Indent Text in Cell
    By iyoung2001 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-14-2020, 05:24 PM
  3. How wrap text in a cell is indent?
    By kent97 in forum Excel General
    Replies: 3
    Last Post: 02-26-2015, 11:03 AM
  4. [SOLVED] Loop trough table cells, identify alignment and indent according to conditions (VBA)
    By christensen in forum Word Formatting & General
    Replies: 6
    Last Post: 08-15-2012, 08:55 AM
  5. How can I query the 'indent' level of text in a cell?
    By NJDevil in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-12-2005, 12:05 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