Worksheet_Change Triggering 3 times.

atrels

New Member
Joined
Aug 2, 2020
Messages
12
Office Version
  1. 365
Platform
  1. Windows
Hi All,

My worksheet_change VBA code is located on Sheet1.

There is data validation on this worksheet, so if a user enters data outside the restrictions, then type in "N/A" the macro triggers 3 times.

Why is this the case? Is there any way I can solve it so it only runs once? My code is below.

VBA Code:
Option Explicit

Option Compare Text

Sub Worksheet_Change(ByVal Target As Range)
    Dim rInt As Range
    Dim k As Range
    Dim Substitute As Range
    Dim C As String
    Dim R As String
    With Target
        If .Cells.Count = 1 And Not (Application.Intersect(.Cells, Range("A14:T999")) Is Nothing) Then
            If .Value = "N/A" Then
                Application.EnableEvents = False
                Initials_Comment_Box.TextBox1 = Target.Address
                Initials_Comment_Box.Show
                Application.EnableEvents = True
            End If
        End If
    End With
End Sub

I found here a claim: "Three times: once for the user's first, invalid entry; once for data-validation's restoration of the previous value; and once for the user's updated entry (or acceptance of the restored value, selecting a different cell)."

I need the workbook to function normally - E.g. Be able to still select multiple cells and delete them.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Could anyone help me?


E.g. Normal Function.

enter image description here

E.g. Triple trigger from Data Validation Function.

enter image description here
 
Upvote 0

Forum statistics

Threads
1,214,973
Messages
6,122,534
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top