+ Reply to Thread
Results 1 to 4 of 4

Clearing a cell that triggers Worksheet_Change event

  1. #1
    Forum Contributor
    Join Date
    03-11-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2016 (among others!)
    Posts
    331

    Clearing a cell that triggers Worksheet_Change event

    I have the following code in my sheet:

    Please Login or Register  to view this content.

    Those cells are dropdown choices - repayment or advance. It works perfectly, except..... if someone deletes the contents of the cell, which is perfectly fine, the code throws a wobbly. It states there is a mismatch at that first If statement.

    I have tried the following to trap it:

    Please Login or Register  to view this content.
    But checking this even deleting the box contents still returns false as an answer. I am going to presume as it has data validation in there (which is how the drop down is achieved.

    Does anyone have any ideas on getting round this?

    Many thanks.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Clearing a cell that triggers Worksheet_Change event

    Try using Target instead of Range(Target.Address) in the Intersect.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    03-11-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2016 (among others!)
    Posts
    331

    Re: Clearing a cell that triggers Worksheet_Change event

    I tried that but no difference - f course I then realised I had misled you. That is not the statement it fails on with the mismatch. It is the IF that is further down looking for the text "Repayment"

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Clearing a cell that triggers Worksheet_Change event

    Does this work?
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Event Triggers
    By CapstanJD in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-27-2014, 03:14 PM
  2. ComboBox1_Change that triggers Worksheet_Change
    By batchy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-25-2013, 07:27 AM
  3. Worksheet_Change Event does not execute upon change of cell
    By KarlaM in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-11-2013, 07:04 PM
  4. Combobox change event and clearing cell range
    By prestopr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-19-2013, 07:56 AM
  5. Event Macro that Triggers Cut/Paste
    By dennis0918 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2011, 08:37 AM
  6. BeforeUpdate Event triggers twice
    By drinkwater.mark@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-04-2006, 04:15 AM
  7. Event Triggers
    By MVM in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-31-2005, 11:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1