Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The changes in column C are the result of formulas.
The Change Event works fine for changes entered in column C. Not getting the Calculate to either 'see' the change/calculate or Evaluate the Countif when the formulas produce a duplicate in column C. Thanks. Howard Private Sub Worksheet_Calculate() Dim Target As Range Set Target = Columns(3) If Evaluate("Countif(C1:C100," & Target.Address & ")") 1 Then MsgBox Target.Value & " is a duplicate entry. It will be removed.", vbExclamation, "Data Entry Editor" Target.Resize(1, 10).ClearContents End If End Sub Private Sub Worksheet_Change(ByVal Target As Range) If Target.Count 1 Then Exit Sub If Target.Column = 3 And Len(Target.Value) 0 Then If Evaluate("Countif(C:C," & Target.Address & ")") 1 Then MsgBox Target.Value & " is a duplicate entry. It will be removed.", vbExclamation, "Data Entry Editor" Target.Resize(1, 10).ClearContents End If End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Event codes don't fire with change or calculate | Excel Programming | |||
apply cell change event to single column - WorksheetChange Event | Excel Programming | |||
MsgBox in Enter event causes combobox not to run Change event | Excel Programming | |||
Change event and calculate event | Excel Programming |