View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Entering Data into Column C based on word from Column A

Here is another version:
Sub AnmlCrkrs()
Animal = Array("Dog", "Cat", "Elephant", "Giraffe")
lstRw = Cells(Rows.Count, 1).End(xlUp).Row
counter = 0
Do Until counter = 4
For Each c In Range("A2:A" & lstRw)
If c.Value Like "*" & Animal(counter) & "*" Then
cRng = c.Address
If counter = 0 Then
Range(cRng).Offset(0, 2) = "Doggy"
ElseIf counter = 1 Then
Range(cRng).Offset(0, 2) = "Kitty"
ElseIf counter = 2 Then
Range(cRng).Offset(0, 2) = "Pachy"
ElseIf counter = 3 Then
Range(cRng).Offset(0, 2) = "LongNeck"
End If
End If
Next
counter = counter + 1
Loop
End Sub



"J.J." wrote:

I am currently trying to figure out a macro that will enter data into
column C depending on a word in Column A

Column A Column B Column C

Dog Doggy
Cat
Elephant
Giraffe
Dog Food Doggy
Cat Food
Elephant Food
Giraffe Food

How do I go about doing this? Any help would be greatly appreciated.