View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Marc
 
Posts: n/a
Default Data Validation with "VBA Refreshing" out of order

Dear All,
I am adjusting an excel.sample, discovered in this beautiful website
http://www.contextures.com/excelfiles.html to my purpose for job. The
spreadsheet
sample is: http://www.contextures.com/excelfile...#DataValNameID , but I
realize that it doesn't work or I should say, it works only in the dedicated
cells, built by the author (B2:B16) and not in a different range (such as
I6:I16). I analized the VBA routine, but I didn't see anything strange,
perhaps I missed something.

Can anyone help me in refreshing the Data Validation in another cells range?
Thanks in advance,
Marc


°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
The routine is as follow:
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo errHandler
If Target.Cells.Count 1 Then GoTo exitHandler
If Target.Column = 2 Then
If Target.Value = "" Then GoTo exitHandler
Application.EnableEvents = False
Target.Value = Worksheets("Codes").Range("C1") _
.Offset(Application.WorksheetFunction _
.Match(Target.Value, Worksheets("Codes").Range("ProdList"), 0), 0)
End If

exitHandler:
Application.EnableEvents = True
Exit Sub

errHandler:
If Err.Number = 13 Or Err.Number = 1004 Then
GoTo exitHandler
Else
Resume Next
End If

End Sub

Sub MyFix()
Application.EnableEvents = True

End Sub