Code causing the undo and redo buttons not to work

R

Richard

When I disable this code the undo/redo buttons work. Why?
Can it be changed?
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal
Target As Excel.Range)
Application.EnableEvents = False
On Error GoTo ws_exit
If Not Application.Intersect(Target, Range("a:i")) Is
Nothing Then
Target(1).Value = UCase(Target(1).Value)
End If
Range("G2").Value = Date
ws_exit:
Application.EnableEvents = True
End Sub
 
C

Chip Pearson

Richard,

If VBA code makes any change to a worksheet, the Undo buffer is cleared.
This is just the way Excel is designed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top