+ Reply to Thread
Results 1 to 7 of 7

Simple Word macro to indent and space?

  1. #1
    Registered User
    Join Date
    07-19-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    22

    Simple Word macro to indent and space?

    I'm sure it can't be that hard but for the life on me can't figure it out. I have a list of about 1000 names and nicknames pulled from a Excel spreadheet. See example.

    Aergia
    J Ardenia Gaines
    Aesculus
    Donovan Maguigan
    After
    Lawrence Salavatore
    Agnastie Monk, The
    Douglas Page
    Alien
    Suzanne Goulet
    All Smiles
    Mike Campbell
    Aloha!
    Aloha Ann Pfeil
    Always Bonnie & Sometimes Clyde
    Mary Wilcoxson & Phil

    I just need it to look like this

    Aergia
    J Ardenia Gaines

    Aesculus
    Donovan Maguigan

    After
    Lawrence Salavatore

    Agnastie Monk, The
    Douglas Page

    Alien
    Suzanne Goulet

    All Smiles
    Mike Campbell

    Aloha!
    Aloha Ann Pfeil

    Always Bonnie & Sometimes Clyde
    Mary Wilcoxson & Phil

    Indenting the real name and spacing between them.

    Edit, for some reason the post didnt pick up the three space indentation. But upon review I'll settle for the results with only a space between names without the indentation.
    Last edited by Hikertrash; 01-05-2013 at 01:53 PM.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,966

    Re: Simple Word macro to indent and space?

    This is a bit crude but should work.

    Please Login or Register  to view this content.
    I've set the loop to exit after 1000 iterations - so you may need to adjust this.
    Martin

    If my solution has saved you time and/or money, please consider sponsoring my run in the 2020 London Marathon in aid of Cancer Research UK.

    https://uk.virginmoneygiving.com/MartinRice

  3. #3
    Registered User
    Join Date
    07-19-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Simple Word macro to indent and space?

    mrice, that works, thanks so much, but the indent is too much. I only need a two or three space indent

    Aloha!
    (with the real name well past the nick name) Ann Pfeil
    Last edited by Hikertrash; 01-05-2013 at 04:38 PM. Reason: needed to format

  4. #4
    Registered User
    Join Date
    07-19-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Simple Word macro to indent and space?

    Nevermind, I got it. I ran your macro then reset the tab stop. Got just what I needed, thanks!

  5. #5
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,966

    Re: Simple Word macro to indent and space?

    This will do it with spaces.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    07-19-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Simple Word macro to indent and space?

    Very good, thanks again!

  7. #7
    Forum Guru macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,579

    Re: Simple Word macro to indent and space?

    You can actually do this without a macro, using a wildcard Find/Replace, where:
    Find = [!^13]{1,}
    Replace = ^t^&^p
    and the 'Find' format is specified as 'Not Bold'.

    As a macro, this becomes:
    Please Login or Register  to view this content.
    The above code should also run much faster than what you're now using.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

+ 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