LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Worksheet Event Problems

I'm trying to write advanced Data Validation using VBA instead of the
built-in Data Validation because I need a dependent cell to change its value
if an independent cell's value changes (the whole dependent list problem
again). I'm using Worksheet_Change to accomplish this. However, the
following code gives me an error.

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo 0
Stop
Application.Calculation = xlCalculationManual
Application.EnableEvents = False

Range("inpSplineFit").value = "FILLET ROOT SIDE FIT"

Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
end sub

Range("inpSplineFit") = Cell B5, and the name is valid and not the cause of
the problem. The only way to get the error code is to step through the code
because it doesn't display any message by itself. It just errors out and
keeps moving, despite the error handling. The error is 40040,
Application-defined or object-defined error. The worksheet is not protected.
Even more strangely, the exact same code works when used in
Worksheet_SelectionChange.

I've tried deleting the sheet and starting over. I've tried cleaning the
project with Code Cleaner, and nothing works. What is going on?

Thanks,
Matthew Pfluger
 
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
change event problems John Excel Programming 4 December 13th 05 05:58 PM
Event Procedures: Event on Worksheet to fire Event on another Worksheet Kathryn Excel Programming 2 April 7th 04 07:35 PM
Problems with event handlers Italian Job Excel Programming 2 November 12th 03 01:26 AM
If... Then Loop problems in Worksheet Event TB[_3_] Excel Programming 2 August 4th 03 08:45 AM


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

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

About Us

"It's about Microsoft Excel"