look-up table - or - error reporting

E

EngelseBoer

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
 
J

JMay

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
 
E

EngelseBoer

eeeekkk
i wouldnt know how to use this
????????

JMay said:
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
 
E

EngelseBoer

i don't know how to use or apply this advise
my list is some 36,000 animals (rows)
is it possible to do what i need running the info down an ajoining cell
relative to the aminal ?

like we do when using if and sum statements etc?
i don't even know how to evoke the "foo" script you gave me
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

compare data 3

Top