look-up table - or - error reporting
Here's some code - put in a standard module and run "Foo"
Assumes Sex is eithe Dog or Bitch...
Sub Foo()
Set Rng = Range("D2:D" & Range("D65536").End(xlUp).Row)
With Rng
Set Rng1 = .Find(what:="Le Grange Tessa", lookat:=xlWhole)
If Rng1.Offset(0, -2).Value = "Dog" Then
MsgBox "Your selection is a Dog"
Else
MsgBox "Your selection is a Bitch"
End If
End With
End Sub
"EngelseBoer" wrote:
hi, please help
i have a database something like the below,
and i need to run a script so that i can search the Dam's name cloumn 4
find her name in column 1 - and report back if she is not a "bitch"
example "Le Grange Tessa" is a dam - but is a dog
Name Sex Sire Dam
Bob At Quovadis Dog Roodebult Simba Le Grange Tessa
Roodebult Simba Dog Byrne Bobby Sebastiaan Tessa
Byrne Bobby Dog Mizpah Thor Slamat Lyla
Mizpah Thor Dog
Slamat Lyla Bitch
Sebastiaan Tessa Bitch Sebastiaan Monty Hansom Sophfie
Sebastiaan Monty Dog
Hansom Sophfie Bitch
Le Grange Tessa Dog Ferrou Bruno Jess Cloe
regards
EngelseBoer
|