Info

Target.Font.Colorlndex = cInUseColorldx Application.EnableEvents = True Exit Function ErrHandler:

MsgBox "Unexpected error in addAConnection: Target=" & _ Target.Address & vbNewLine _

& "Error=" & Err.Description & " (" & Err.Number & ")" Application.EnableEvents = True End Function

Finally, in deleteAConnection each of the cells involved in the connection is reset to the unused state through the use of the resetValue procedure.

Sub deleteAConnection(Sh As Worksheet, Target As Range, OldVal As String) Dim Conn2 As ExcelCoords Conn2 = WiringToExcelCoords(OldVal) Application.EnableEvents = False On Error GoTo ErrHandler With Conn2

resetValue Sh.Cells(.Row, .Col)

End With resetValue Target Application.EnableEvents = True Exit Sub ErrHandler:

MsgBox "Unexpected error in deleteAConnection: Target=" & _ Target.Address & vbNewLine _

& "Error=" & Err.Description & " (" & Err.Number & ")" Application.EnableEvents = True End Sub

0 0

Post a comment