2007 wont run 2003 worksheet change event

Aussie Grid

New Member
Joined
Jan 14, 2010
Messages
47
I have extensive code on the worksheet change event involving data validation. I've changed macro settings and saved the book as a macro enabled 07 format. The log in form works OK but the change event will only run for the first sheet change. Open and close and again the change event only runs once.
Ideas?
Any & all help appreciated
Aussie Grid
 

DonkeyOte

MrExcel MVP
Joined
Sep 6, 2002
Messages
9,118
Are you by any chance toggling Events in your code and do you have Error Handlers in place ?

Might be an idea to post the ChangeEvent code in the first instance.
 

Aussie Grid

New Member
Joined
Jan 14, 2010
Messages
47
Thank you DonkeyOte for your help. I did have an error handler in place which exited sub on error. This was fine with 03 but 07 obviously didn't like it. Removed it and have had no more trouble.
TKU
Aussie Grid
 

DonkeyOte

MrExcel MVP
Joined
Sep 6, 2002
Messages
9,118
The Exit Sub would only be an issue if you had Disabled Events beforehand and were not reinstating them prior to Exit...

One way of handling in this manner is to use an Exit Point

Code:
Sub Marine()
Dim dblX As Double
On Error GoTo ExitPoint
Application.EnableEvents = False
dblX = 1 / Round(Rand(),0)
MsgBox "No Error!"
ExitPoint:
Application.EnableEvents = True
End Sub
this way, regardless of whether routine throws an error or not the Events are always reinstated... obviously this is a simplified example but...

Regards error handling practices: http://www.cpearson.com/excel/ErrorHandling.htm
 

Forum statistics

Threads
1,081,530
Messages
5,359,349
Members
400,524
Latest member
Excelbat

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top