Results 1 to 4 of 4
  1. #1
    3 Star Lounger Omega3's Avatar
    Join Date
    Jan 2004
    Location
    Los Angeles, California, USA
    Posts
    343
    Thanks
    2
    Thanked 1 Time in 1 Post
    Sometimes Iíll get a document that someone has put over 20 tabs on the ruler. Is there any VBA code that can clear all the tabs in the ruler on every line and just set one tab at 1.25 inches on each line?

    I know Iíll have to go through the document to make sure everything is formatted correctly and insert proper tabs and sometimes remove tab characters. I won't know if it's worth it until I can create the macro.
    You know it's time to diet when you push away from the table and the table moves.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Here is a macro:

    Code:
    Sub ClearSetTabs()
      With ActiveDocument.Paragraphs.TabStops
        .ClearAll
        .Add Position:=Application.InchesToPoints(1.25)
      End With
    End Sub
    This will act on the entire document. If you'd prefer the macro to act on the currently selected text only, change ActiveDocument to Selection.

  3. #3
    3 Star Lounger Omega3's Avatar
    Join Date
    Jan 2004
    Location
    Los Angeles, California, USA
    Posts
    343
    Thanks
    2
    Thanked 1 Time in 1 Post
    Quote Originally Posted by HansV View Post
    Here is a macro:

    Code:
    Sub ClearSetTabs()
      With ActiveDocument.Paragraphs.TabStops
        .ClearAll
        .Add Position:=Application.InchesToPoints(1.25)
      End With
    End Sub
    This will act on the entire document. If you'd prefer the macro to act on the currently selected text only, change ActiveDocument to Selection.
    Thank you Hans for this help. If it becomes too difficult to reformat the document after I clear the tabs for all the lines then Iíll use your second option of clearing the selected text. I have the feeling I may have to do the later option but I wonít know until I run the macro and see the results (gulp). It may be too much to do. The documents usually run around 30-50 pages.

    Thanks again.
    You know it's time to diet when you push away from the table and the table moves.

  4. #4
    2 Star Lounger
    Join Date
    Nov 2006
    Posts
    102
    Thanks
    12
    Thanked 2 Times in 2 Posts
    If you don't do this regularly, you don't need a macro.

    1. Highlight the document (CTRL-A) or the section you want to clear the tabs from.
    2. Go to Paragraph Format.
    3. Click on Tabs.
    4. Click on Clear All and OK.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •