![]() |
|
|
Thread Tools | Display Modes |
#1
|
||||
|
||||
![]()
Hello pros,
I've succeeded to create a macro for Table Borders LineWidth to act as a Variant for the Last Row, for the bottom border. Re: LineWidth = (sVar1), it remains at 1,50pt. Why? Code:
Sub Table_1_Borders_LastRow_Top_050pt_Bottom_Var() Dim aTbl As Table Dim sVar1 As Variant 'Border size for the bottom row, bottom border. Dim LineWidth As Borders Set aTbl = ActiveDocument.Tables(1) With Selection.Tables(1) .Rows.Last.Range.Select End With sVar1 = InputBox("Enter the Border size for the bottom row, on bottom border." _ & vbCr & "Exemple en pt : 0.25, 0.50, 0.75, 1.00, 1.50, 2.25, 3.00, 4.50, 6.00.", "SUGGESTION", "3") sVar1 = aTbl.Borders(wdBorderBottom).LineWidth With Selection.Range With .Borders(wdBorderTop) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth050pt .Color = wdColorAutomatic End With With .Borders(wdBorderBottom) .LineStyle = wdLineStyleSingle '.LineWidth = wdLineWidth150pt .LineWidth = sVar1 .Color = wdColorAutomatic End With End With On Error GoTo 0 End Sub What am I doing wrong, in your opinion? Could any expert guide me please? I would be sooooo grateful. Cendrinne Last edited by Cendrinne; 09-05-2022 at 02:27 AM. Reason: Got it to work, but still have an issue..... |
Tags |
borders, help please, variant |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with table borders | synint | Word | 2 | 12-02-2021 01:44 AM |
![]() |
Peterson | Word VBA | 2 | 09-06-2021 05:52 PM |
![]() |
ljosmynd | Word Tables | 1 | 02-02-2016 12:29 AM |
![]() |
tenpaiman | Word | 2 | 08-08-2012 07:20 PM |
how can i make random variant | neezeen | Word | 0 | 11-22-2011 08:08 AM |