[color=darkblue]Sub[/color] Button_Click()
[color=darkblue]Dim[/color] v [color=darkblue]As[/color] [color=darkblue]Variant[/color]
[color=darkblue]With[/color] Sheets("Invoice").Range("C12")
[color=darkblue]If[/color] .Value = "" [color=darkblue]Then[/color]
.Value = Sheets("Customers").Range("A2").Value
[color=darkblue]Else[/color]
v = Application.Match(.Value, Sheets("Customers").Range("A2:A25"), 0)
[color=darkblue]If[/color] IsNumeric(v) [color=darkblue]Then[/color]
.Value = Sheets("Customers").Range("A2:A25").Cells(v + 1, 1).Value
[color=darkblue]Else[/color]
.Value = ""
[color=darkblue]End[/color] [color=darkblue]If[/color]
[color=darkblue]End[/color] [color=darkblue]If[/color]
[color=darkblue]End[/color] [color=darkblue]With[/color]
[color=darkblue]End[/color] [color=darkblue]Sub[/color]