We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question
0

View Individual border width? [closed]

asked 2017-07-13 20:33:49 +0200

appreciatethehelp gravatar image

updated 2020-08-07 22:47:19 +0200

Alex Kemp gravatar image

Hi.

I know that, when all of the cell's borders are the same width, the width of the borders is displayed under the width section under Format > Cells > Borders tab.

However, I want to know how to view the width of an individual border when it differs from the others e.g the width of the top border in the cell is 2pt and the others are 1pt; how would I know the width of each individual border? Selecting each different border under Format > Cells > Borders tab doesn't change the figure in the width section, regardless of the actual width of the selected border/s.

PLUS ANOTHER RELATED BUT DIFFERENT QUESTION, while you're here… it is best explained with these two images (in order):

C:\fakepath\1Screen Shot 2017-07-14 at 5.58.53 AM.png

C:\fakepath\Screen Shot 2017-07-14 at 5.59.14 AM.png

(edit: activated screenshots)

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2020-08-07 22:47:38.434411

1 Answer

Sort by » oldest newest most voted
0

answered 2017-07-14 05:15:41 +0200

librebel gravatar image

Hello @appreciatethehelp,

I could not find a place in the GUI that shows the values for the individual borderline widths of a cell. However you could use the following macro to obtain these values:

Function getCellBorderLineWidths( strCellName As String )
REM Returns an array containing the Line Widths in 100thMM for the ( T, L, B, R ) Borders of the specified Cell.
REM <strCellName>:  pass a Cell address such as "A1" or "$A$1".
    Dim oSheet As Object, oCell As Object, oBorder As Object
    Dim lWidth(3) As Long, i As Integer
    oSheet = ThisComponent.getCurrentController().getActiveSheet()
    oCell = oSheet.getCellRangeByName( strCellName )
    For Each oBorder In Array( oCell.TopBorder2, oCell.LeftBorder2, oCell.BottomBorder2, oCell.RightBorder2 )   
        lWidth( i ) =  oBorder.LineWidth
        If lWidth(i) = 0 Then lWidth(i) = oBorder.InnerLineWidth + oBorder.LineDistance + oBorder.OuterLineWidth
        i = i + 1
    Next
    getCellBorderLineWidths = lWidth()
End Function
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-07-13 20:33:49 +0200

Seen: 281 times

Last updated: Aug 07 '20