Option
Explicit
Private
Type CELL_UNDERLINE
enmUnderLine
As
XlLineStyle
strAddress
As
String
strShName
As
String
End
Type
Private
mudtUnderLine
As
CELL_UNDERLINE
Private
Sub
Workbook_Open()
With
mudtUnderLine
.enmUnderLine = ActiveCell.Borders(xlEdgeBottom).LineStyle
.strAddress = ActiveCell.Address
.strShName = ActiveSheet.Name
End
With
End
Sub
Private
Sub
Workbook_SheetSelectionChange(
ByVal
Sh
As
Object
,
ByVal
Target
As
Range)
With
mudtUnderLine
If
Sh.Name = .strShName
Then
If
Target.Address <> .strAddress
Then
_
If
Range(.strAddress).Borders(xlEdgeBottom).LineStyle <> xlNone
Then
_
Cells(1, 1) = .strAddress &
" ist unterstrichen"
.enmUnderLine = Target.Borders(xlEdgeBottom).LineStyle
.strAddress = Target.Address
End
If
End
With
End
Sub