Ask Your Question

View Individual border width?

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

appreciatethehelp gravatar image


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 retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

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
    getCellBorderLineWidths = lWidth()
End Function
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


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

Seen: 119 times

Last updated: Jul 14 '17