Public Usf As UserForm1
Public Sub UsfOpen()
Set Usf = New UserForm1
Usf.Show 0
End Sub
Public Sub UsfClose()
If Not (Usf Is Nothing) Then
Unload Usf
Set Usf = Nothing
End If
End Sub
dans ThisWorkbook
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
UsfClose
End Sub
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
UsfClose
End Sub
Public Usf As UserForm1
Public Sub UsfOpen()
Set Usf = New UserForm1
Usf.Show 0
End Sub
Public Sub UsfClose()
If Not (Usf Is Nothing) Then
Unload Usf
Set Usf = Nothing
End If
End Sub
dans ThisWorkbook
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
UsfClose
End Sub
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
UsfClose
End Sub