Private Sub Worksheet_Activate()
Dim inputRange As Range, rng As Range
Set inputRange = Evaluate(Range("[COLOR="#FF0000"]A1[/COLOR]").Validation.Formula1)
For Each rng In inputRange
Range("[COLOR="#FF0000"]A1[/COLOR]") = rng
Exit For
Next rng
End Sub
Set inputRange = Evaluate(Range("G13").Validation.Formula1)
=IF(ISERROR(MATCH(G13,DATABASE!A:A,0)),"",MATCH(G13,DATABASE!A:A,0))
Set inputRange = Evaluate(Range("A6").Validation.Formula1)
Private Sub SelectFirstEntry_Click() Dim v As Variant
With Sheets("INV").Range("G13")
If .Value = "" Then
.Value = Sheets("Customers").Range("A5").Value
Else
v = Application.Match(.Value, Sheets("DATABASE").Range("A5:A100"), 0)
If IsNumeric(v) Then
.Value = Sheets("DATABASE").Range("A5:A100").Cells(v + 1, 1).Value
Else
.Value = ""
End If
End If
End With
End Sub
Set inputRange = Evaluate(Range("A6").Validation.Formula1)