Ramon
2012-02-21 12:34:20 UTC
Ho inserito in un mio foglio Excel la macro che allego in basso per
nascondere delle righe in base a determinate condizioni. Ora, però, se
scrivo qualcosa in altre celle (non le celle coinvolte dalla macro), non
è più attivo il pulsante undo per annullare una modifica in queste celle
(ovviamente solo nel foglio in cui c'è la macro). Se tolgo la macro,
l'undo ritorna a funzionare. Come posso fare?
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
If Range("T9") = Range("V9") Then
Rows("13:17").EntireRow.Hidden = True
Rows("18:18").EntireRow.Hidden = False
Rows("19:22").EntireRow.Hidden = True
ElseIf Range("T9") = Range("V8") Then
Rows("13:22").EntireRow.Hidden = True
ElseIf Range("T9") = "" Then
Rows("13:22").EntireRow.Hidden = True
Else
Rows("13:22").EntireRow.Hidden = False
End If
End Sub
nascondere delle righe in base a determinate condizioni. Ora, però, se
scrivo qualcosa in altre celle (non le celle coinvolte dalla macro), non
è più attivo il pulsante undo per annullare una modifica in queste celle
(ovviamente solo nel foglio in cui c'è la macro). Se tolgo la macro,
l'undo ritorna a funzionare. Come posso fare?
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
If Range("T9") = Range("V9") Then
Rows("13:17").EntireRow.Hidden = True
Rows("18:18").EntireRow.Hidden = False
Rows("19:22").EntireRow.Hidden = True
ElseIf Range("T9") = Range("V8") Then
Rows("13:22").EntireRow.Hidden = True
ElseIf Range("T9") = "" Then
Rows("13:22").EntireRow.Hidden = True
Else
Rows("13:22").EntireRow.Hidden = False
End If
End Sub