View Single Post
 
Old 09-12-2022, 10:51 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Windows 10 Office 2019
Competent Performer
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 200
Cendrinne is on a distinguished road
Default Hello, my old friend, nice to hear from you :)

Quote:
Originally Posted by gmaxey View Post
You could employ a simple userform with two listboxes and a command button. Let prone to user errors:

Code:
Option Explicit
Private Sub UserForm_Initialize()
 With ListBox1
   .AddItem
   .List(.ListCount - 1, 0) = "0.25 pt"
   .List(.ListCount - 1, 1) = 2
   .AddItem
   .List(.ListCount - 1, 0) = "0.50 pt"
   .List(.ListCount - 1, 1) = 4
   .AddItem
   .List(.ListCount - 1, 0) = "0.75 pt"
   .List(.ListCount - 1, 1) = 6
   .AddItem
   .List(.ListCount - 1, 0) = "1 pt"
   .List(.ListCount - 1, 1) = 8
   .AddItem
   .List(.ListCount - 1, 0) = "1.5 pt"
   .List(.ListCount - 1, 1) = 12
   .AddItem
   .List(.ListCount - 1, 0) = "2.25 pt"
   .List(.ListCount - 1, 1) = 18
   .AddItem
   .List(.ListCount - 1, 0) = "3.00 pt"
   .List(.ListCount - 1, 1) = 24
   .AddItem
   .List(.ListCount - 1, 0) = "4.5 pt"
   .List(.ListCount - 1, 1) = 36
   .AddItem
   .List(.ListCount - 1, 0) = "6 pt"
   .List(.ListCount - 1, 1) = 48
   .ListIndex = 3
  End With
  With ListBox2
    .List = ListBox1.List
    .ListIndex = 5
  End With
lbl_Exit:
  Exit Sub
End Sub

Private Sub CommandButton1_Click()
Dim oTbl As Table
  For Each oTbl In ActiveDocument.Tables
    oTbl.Rows.Last.Range.Select
    With Selection.Range
      With .Borders(wdBorderTop)
        .LineStyle = wdLineStyleSingle
        .LineWidth = ListBox1.Column(1)
        .Color = wdColorAutomatic
      End With
      With .Borders(wdBorderBottom)
        .LineStyle = wdLineStyleSingle
        .LineWidth = ListBox2.Column(1)
        .Color = wdColorAutomatic
      End With
    End With
  Next oTbl
lbl_Exit:
  Exit Sub
End Sub
OK, I'll look at it tomorrow.
Just came to check something, but must go to bed for work.

Night night. Nice hearing from you
Reply With Quote