Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Worksheet_Change/macros not working

Hi all,
I have several sheets using Worksheet_Change. They work great. But... if
there is an error the macros stop working. I close and open the workbook and
the macros as still not working. How do I 'start them up' again?
Thanks for any help.
Regards,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Worksheet_Change/macros not working

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
' do your stuff
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Myriam" wrote in message
...
Hi all,
I have several sheets using Worksheet_Change. They work great. But... if
there is an error the macros stop working. I close and open the workbook
and
the macros as still not working. How do I 'start them up' again?
Thanks for any help.
Regards,



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Worksheet_Change/macros not working

Thanks! Perfect!

"Bob Phillips" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
' do your stuff
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Myriam" wrote in message
...
Hi all,
I have several sheets using Worksheet_Change. They work great. But... if
there is an error the macros stop working. I close and open the workbook
and
the macros as still not working. How do I 'start them up' again?
Thanks for any help.
Regards,




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
worksheet_change not working scottwilsonx[_63_] Excel Programming 0 October 22nd 04 05:07 PM
worksheet_change not working scottwilsonx[_62_] Excel Programming 0 October 22nd 04 05:06 PM
Worksheet_Change method not working in Excel 97 Manoj Kumar Sharma Excel Programming 4 October 6th 04 10:38 AM
Worksheet_Change not working when using paste papou[_7_] Excel Programming 1 September 5th 03 12:57 PM
Worksheet_Change Event Not Working Michael Beckinsale Excel Programming 0 August 1st 03 02:43 PM


All times are GMT +1. The time now is 07:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"