Simple Code Help

D

DaveB

Can you please help me with some code:

If in columns 1-3000, there is a sentence with "INC" in
it, then in column 2 the word "CORP" should appear.

If in columns 1-3000, there is a sentence with "SOCIETY"
in it, then in column 2 the word "ASSC/FNDN" should appear.

If in columns 1-3000, there is a sentence
with "FOUNDATION" in it, then in column 2 the
word "ASSC/FNDN" should appear.

If in columns 1-3000, there is a sentence
with "UNIVERSITY" in it, then in column 2 the word "ACAD"
should appear.

Thanks. DaveB
 
K

Ken

Dave,
This should work.


Sub FindStuff()
Dim Iloop As Double
For Iloop = 1 To 3000
If UCase(Cells(Iloop, 1)) Like "*INC*" Then
Cells(Iloop, 2) = "CORP"
ElseIf UCase(Cells(Iloop, 1)) Like "*SOCIETY*" Or
UCase(Cells(Iloop, 1)) Like "*FOUNDATION*" Then
Cells(Iloop, 2) = "ASSC/FNDN"
ElseIf UCase(Cells(Iloop, 1)) Like "*UNIVERSITY*"
Then
Cells(Iloop, 2) = "ACAD"
End If
Next Iloop
End Sub
 

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

Top