Sub a()
Dim SideBorderPoints As Single
Dim TopBorderPoints As Single
Dim BottomBorderPoints As Single
Call GetUserFormInvisibleMargins(Usf, SideBorderPoints, TopBorderPoints, BottomBorderPoints)
MsgBox "SideBorderPoints = " & SideBorderPoints & vbCrLf & _
"BottomBorderPoints = " & BottomBorderPoints & vbCrLf & _
"TopBorderPoints = " & TopBorderPoints
End Sub
Public Sub GetUserFormInvisibleMargins(Usf As Object, _
ByRef SideBorderPoints As Single, _
ByRef TopBorderPoints As Single, _
ByRef BottomBorderPoints As Single)
Const UserFormCaptionHeight = 22
SideBorderPoints = (Usf.Width - Usf.InsideWidth) / 2
BottomBorderPoints = SideBorderPoints
TopBorderPoints = Usf.Height - Usf.InsideHeight - UserFormCaptionHeight - BottomBorderPoints
End Sub