View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Mikus Mikus is offline
external usenet poster
 
Posts: 33
Default How to reset macro to run again after error ?

This is the code that creates type mismatch error.
Fow examle if i try to delete entire row or copy entire row... and so on

As you can see i already have "Application.EnableEvents = True"

Sub Worksheet_Change(ByVal Target As Range)
25
If Target.Column = 1 And Target.Value = "Priv" Then
'Range(Cells(Target.Row, 2), Cells(Target.Row, 3)).Value = "-"
Cells(Target.Row, 2).Value = "-"
Cells(Target.Row, 3).Select
Else
'Whatever original value or formulae for B and C
End If
Application.EnableEvents = True
End Sub

"Bob Phillips" wrote:

Do you mean event code? If so just type Application.EnableEvents = True in
the immediate window.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mikus" wrote in message
...
Sometimes when i get type mismatch error while running macro excel shows
error messege box and then opens vb code section and then i have to click
[end]. After that macro won't trigger anymore. Is there any way to reset
macro trigerring without closing & reopening excel ? Cuz this is what i
ussualy do if i encounter this error.