Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #13  
Old 09-13-2022, 11:36 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Help, Please, Table Borders LineWidth act as a Variant. Why Variant disregards my variant value? Windows 10 Help, Please, Table Borders LineWidth act as a Variant. Why Variant disregards my variant value? Office 2019
Competent Performer
Help, Please, Table Borders LineWidth act as a Variant. Why Variant disregards my variant value?
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 200
Cendrinne is on a distinguished road
Default Hi Greg, I've tried it but I'm not familiar how to fix it.......

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
You are WAY more advance than my level of knowledge. Wow, Wish you would make a book for less familiar people. Even stuff on your website, I'm not certain to understand lot's of contents.

Re this script,
I get an error message, and it highlights ListBox. It say's it's undefined Variable.
So I've tried to put Dim ListBox1 As ListBox, ListBox2 As ListBox = Worked but now it flags .AddItem

So I wish to have tried it, but I need more guidance to figure out what it's supposed to do.

But I'm truly grateful for your wanting to help me

Got to go to bed for now.

Night night
Reply With Quote
 

Tags
borders, help please, variant



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with table borders synint Word 2 12-02-2021 01:44 AM
Help, Please, Table Borders LineWidth act as a Variant. Why Variant disregards my variant value? How is a variant array created to pass properties to a style? Peterson Word VBA 2 09-06-2021 05:52 PM
Help, Please, Table Borders LineWidth act as a Variant. Why Variant disregards my variant value? table over 2 pages without borders ljosmynd Word Tables 1 02-02-2016 12:29 AM
Help, Please, Table Borders LineWidth act as a Variant. Why Variant disregards my variant value? Page-crossing borders in a table with hidden between-cell borders tenpaiman Word 2 08-08-2012 07:20 PM
how can i make random variant neezeen Word 0 11-22-2011 08:08 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:08 PM.


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