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: 10
Default Worksheet_Change event very slow

Hi

I'm working on a worksheet where I have a field for "Type of
Insurance" and "Amount of Insurance". Both these cells have Validation
lists in them. I want to achieve the following:

- If the user chooses "None" for the Type of Insurance, then whatever
is in the Amount of Insurance field should immediately change to a
blank.
- Also, the user should not be allowed to change whatever is in the
Amount of Insurance cell while the Type of Insurance is "None".

I have multiple variations of the above situation on the sheet where
instead of "Insurance", it deals with "Guarantees" and so on but the
idea is the same.

I've tried using the Worksheet_Change event which works fine but it
seems to be slowing down as I add more checks. Is there an efficient
and easy way to achieve what I want?

Here's (an extract of) my code:

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$D$46" Then
If Range("D46").Value = "None" Then
Range("D47").Value = 0
End If
End If

If Target.Address = "$D$47" Then
If Range("D46").Value = "None" Then
Range("D47").Value = ""
End If
End If

End Sub

Basically I have a whole bunch if If Then statements following each
other in the full code and I think that's what's slowing it down.

Suggestions?
 
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
How do I change a Worksheet_change event to a beforesave event? Tueanker Excel Programming 5 June 29th 07 03:00 PM
Worksheet_Change slow BRFx2 Excel Programming 8 June 28th 06 02:58 PM
Code WAY too slow... (worksheet_change event) [email protected] Excel Programming 0 January 11th 05 08:34 PM
Worksheet_change event. Mike K Excel Programming 8 October 24th 04 09:00 PM
Worksheet_change event Dwayne Smith Excel Programming 2 June 5th 04 03:25 AM


All times are GMT +1. The time now is 06:16 PM.

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"