Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-19-2021, 08:03 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Dot Leader in 1 or all Table of Column 1, Help!!!!! Windows 10 Dot Leader in 1 or all Table of Column 1, Help!!!!! Office 2019
Competent Performer
Dot Leader in 1 or all Table of Column 1, Help!!!!!
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 190
Cendrinne is on a distinguished road
Default Dot Leader in 1 or all Table of Column 1, Help!!!!!

Hello Experts, Happy New Year, by the way



I've been trying, searching, to find a way, to have either 1 table column 1 or all Tables column 1, to place a dot leader, and without needing to manually do a Ctrl+Tab on each row at the end of the text.

Not funny when there is 40 rows, and 38 tables in a word Document.

Is it possible or not? I've tried creating a style. Created a kb macro to select column 1 and have the Right Tab stop Dot leader put, but still, I have to manually do the Ctrl+Tab on each rows, at the end of the text.

Frustrated. It doesn't happen often, maybe 2 a year, but it's so long when I know there must be a macro, script, that could ease my pain.

I can't seem to find an answer. Unless I'm not asking the right way in my google search.

Please help???

Last edited by Cendrinne; 01-20-2021 at 07:34 AM.
Reply With Quote
  #2  
Old 01-19-2021, 09:47 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Dot Leader in 1 or all Table of Column 1, Help!!!!! Windows 10 Dot Leader in 1 or all Table of Column 1, Help!!!!! Office 2019
Competent Performer
Dot Leader in 1 or all Table of Column 1, Help!!!!!
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 190
Cendrinne is on a distinguished road
Default

Never mind, I found a way I've programmed it manually but it works regardless how many rows I have

Code:
Sub Create_Dot_Leader_1Tbl_Col_1()
'
    Application.ScreenUpdating = False
    Dim oTbl As Table
    Dim oRow As Row
    Dim oCell As cell

  Set oTbl = Selection.Tables(1)
    With Selection.ParagraphFormat
        .TextboxTightWrap = wdTightNone
        .CollapsedByDefault = False
    End With
    Selection.ParagraphFormat.TabStops.ClearAll
    ActiveDocument.DefaultTabStop = InchesToPoints(0.25)
    Selection.ParagraphFormat.TabStops.Add Position:=InchesToPoints(5.25), _
        Alignment:=wdAlignTabRight, Leader:=wdTabLeaderDots
    
  oTbl.Columns(1).Select
  For Each oRow In oTbl.Rows
    
    Selection.SelectRow
    Selection.HomeKey Unit:=wdLine
    Selection.EndKey Unit:=wdLine
    Selection.TypeText Text:=vbTab
    Selection.Move Unit:=wdRow, Count:=1
    
    Next oRow
     On Error Resume Next

    Application.ScreenUpdating = True

    On Error GoTo 0

End Sub
If experts think it should be tweaked, please let me know

Cendrinne
Reply With Quote
  #3  
Old 01-19-2021, 09:59 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Dot Leader in 1 or all Table of Column 1, Help!!!!! Windows 10 Dot Leader in 1 or all Table of Column 1, Help!!!!! Office 2019
Competent Performer
Dot Leader in 1 or all Table of Column 1, Help!!!!!
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 190
Cendrinne is on a distinguished road
Default

I have a couple of questions for only the dots per row.

Is there a way to have only the dots spaced out to 2 pt?
And
Is there a way, that the dots NOT be Bold, regardless if the Start of the cell is Bold?
Reply With Quote
  #4  
Old 01-19-2021, 11:30 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Dot Leader in 1 or all Table of Column 1, Help!!!!! Windows 10 Dot Leader in 1 or all Table of Column 1, Help!!!!! Office 2019
Competent Performer
Dot Leader in 1 or all Table of Column 1, Help!!!!!
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 190
Cendrinne is on a distinguished road
Default

Found that too. I've done all manually, but tweaked it with scripts from other tables and rows.

Code:
Sub Create_Dot_Leader_1Tbl_Col_1_SpacedOut()
    Application.ScreenUpdating = False
    Dim oTbl As Table
    Dim oRow As Row
    Dim oCell As cell

  Set oTbl = Selection.Tables(1)
    With Selection.ParagraphFormat
        .TextboxTightWrap = wdTightNone
        .CollapsedByDefault = False
    End With
    Selection.ParagraphFormat.TabStops.ClearAll
    ActiveDocument.DefaultTabStop = InchesToPoints(0.25)
    Selection.ParagraphFormat.TabStops.Add Position:=InchesToPoints(5.25), _
        Alignment:=wdAlignTabRight, Leader:=wdTabLeaderDots
    
  oTbl.Columns(1).Select
  For Each oRow In oTbl.Rows
    
    Selection.SelectRow
    Selection.HomeKey Unit:=wdLine
    Selection.EndKey Unit:=wdLine
    Selection.TypeText Text:=vbTab
    Selection.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtend
    With Selection.Font
        .Bold = False
        .Color = wdColorAutomatic
        .Superscript = False
        .Subscript = False
        .Spacing = 2
        .Scaling = 100
        .Position = 0
    End With
    Selection.Move Unit:=wdRow, Count:=1
    
    Next oRow
     On Error Resume Next

    Application.ScreenUpdating = True

    On Error GoTo 0

End Sub
Reply With Quote
  #5  
Old 01-19-2021, 11:33 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Dot Leader in 1 or all Table of Column 1, Help!!!!! Windows 10 Dot Leader in 1 or all Table of Column 1, Help!!!!! Office 2019
Competent Performer
Dot Leader in 1 or all Table of Column 1, Help!!!!!
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 190
Cendrinne is on a distinguished road
Default

Not bad for an Advance Beginner

Now all I have to firgure out, is apply it to all tables in a word document.

Any suggestion is welcome
Reply With Quote
  #6  
Old 01-20-2021, 10:42 AM
gmaxey gmaxey is offline Dot Leader in 1 or all Table of Column 1, Help!!!!! Windows 10 Dot Leader in 1 or all Table of Column 1, Help!!!!! Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,427
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Not exactly sure what you are trying to do. First, it seems your code could be written:

Code:
Sub Create_Dot_Leader_1Tbl_Col_1_SpacedOut()
Dim oTbl As Table
Dim oRow As Row
Dim oCell As Cell
Dim oRng As Range
  Application.ScreenUpdating = False
  Set oTbl = Selection.Tables(1)
  oTbl.Columns(1).Select
  With Selection.ParagraphFormat
    .TextboxTightWrap = wdTightNone
    .CollapsedByDefault = False
    .TabStops.ClearAll
    .TabStops.Add Position:=InchesToPoints(5.25), _
         Alignment:=wdAlignTabRight, Leader:=wdTabLeaderDots
  End With
  For Each oRow In oTbl.Rows
    Set oRng = oRow.Cells(1).Range
    With oRng
      .End = .End - 1
      .Collapse wdCollapseEnd
      .InsertAfter vbTab
      With .Font
        .Bold = False
        .Color = wdColorAutomatic
        .Spacing = 2
      End With
    End With
  Next oRow
  Application.ScreenUpdating = True
lbl_Exit:
  Exit Sub
End Sub

To process all tables then change to this:

Code:
Sub Create_Dot_Leader_1Tbl_Col_1_SpacedOut()
Dim oTbl As Table
Dim oRow As Row
Dim oCell As Cell
Dim oRng As Range
  Application.ScreenUpdating = False
  For Each oTbl in ActiveDocument.Tables 'Set oTbl = Selection.Tables(1)
  oTbl.Columns(1).Select
  With Selection.ParagraphFormat
    .TextboxTightWrap = wdTightNone
    .CollapsedByDefault = False
    .TabStops.ClearAll
    .TabStops.Add Position:=InchesToPoints(5.25), _
         Alignment:=wdAlignTabRight, Leader:=wdTabLeaderDots
  End With
  For Each oRow In oTbl.Rows
    Set oRng = oRow.Cells(1).Range
    With oRng
      .End = .End - 1
      .Collapse wdCollapseEnd
      .InsertAfter vbTab
      With .Font
        .Bold = False
        .Color = wdColorAutomatic
        .Spacing = 2
      End With
    End With
  Next oRow
  Next oTbl
  Application.ScreenUpdating = True
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #7  
Old 01-20-2021, 04:57 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Dot Leader in 1 or all Table of Column 1, Help!!!!! Windows 10 Dot Leader in 1 or all Table of Column 1, Help!!!!! Office 2019
Competent Performer
Dot Leader in 1 or all Table of Column 1, Help!!!!!
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 190
Cendrinne is on a distinguished road
Default

Greg!!!!!! Hello

Thank you. I'll test it out later on tonight. What I was trying to do is have my first column with the Dot Leader. I had a situation, where all the Freaking tables had to have a dot leader. So manually, I had to do on each row of column 1, Ctrl+Tab, to show the Dots. I was discourage. Especially when the document was long.

I don't have the skills of you guys experts, but see I've managed on my own. It worked, but I knew it wasn't a proper programing.

Thanks hun I'll test it out and let you know tonight

Cendrinne
Reply With Quote
  #8  
Old 01-20-2021, 08:52 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Dot Leader in 1 or all Table of Column 1, Help!!!!! Windows 10 Dot Leader in 1 or all Table of Column 1, Help!!!!! Office 2019
Competent Performer
Dot Leader in 1 or all Table of Column 1, Help!!!!!
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 190
Cendrinne is on a distinguished road
Default

Hello again, Greg, I've tested it. Wow, that will sure come handy when I get these frustrating documents. Thanks.
At first I got and error message, 5992, cause the Column Collection, are not the same size. Or something similar. I'm translating this from french.

I've realized some top few rows, are merge together. Like Two columns are for Quarter 4, next two column are for Quarter 3 and that is for Row 1. So I've tried to split the first row from the rest and your macros (1 table & All tables) Works

It would be challenging to find a way to tweak those top rows, cause from one table to another, I could have different number of Rows that have some merged columns.

Your Macros, made my Whole Week or Month. WOW, I'm always impressed by programming Pro's skills. CALL ME IMPRESSED

Thank you again soooo much.

Cendrinne
Reply With Quote
Reply

Tags
dot leader table column 1

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Table of Contents with authors and leader dots nanoboy Word 2 07-18-2017 01:04 PM
Dot Leader in 1 or all Table of Column 1, Help!!!!! Dot spacing tab leader in automatic Table of Contents Beunhaas Word 1 11-25-2015 10:27 AM
Dot Leader in 1 or all Table of Column 1, Help!!!!! Format tab leader in “Table of figures” separate from text? WTR_girl12 Word 1 09-03-2015 10:48 AM
Dot Leader in 1 or all Table of Column 1, Help!!!!! Table of contents 2nd line dot leader right tab failure Tsingher Word 2 01-18-2015 09:21 AM
Dot Leader in 1 or all Table of Column 1, Help!!!!! Dot leader in table cells BeerStud Word 11 04-02-2014 07:28 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:20 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft