Why when I use hide columns / rows the undo does not work.

  • Thread starter Thread starter Nils
  • Start date Start date
N

Nils

When I put commands in the spreadsheet with the right
click and view code, then following this, the undo command
no longer works. However, after I remove the code it (the
undo) works again. Can you explain?
=====================================================

Private Sub Worksheet_Change(ByVal Target As Range)
Set TestCell = Range("AZ19")
TestValue = "x"
If TestCell = TestValue Then

Range("A18:a20").EntireRow.Hidden = True
Else
Range("A18:a20").EntireRow.Hidden = False
End If


End Sub
=======================================================

Thanks Nils!
 
Many macro functions reset XL's Undo. Since XL can't tell what was
done in the macro, it doesn't allow undo's after the macro was run.
 
Back
Top