Advanced if statements?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need some help with nested if statements. What I need to write is
something of this format: if(A7="Grade1" and if(B7="Grade1"),"OK",
"Replace")), how do I write this in a nested if statement
 
=IF(AND(A7="Grade 1",B7="Grade 1"), "matched","not matched")

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Hi Ralph,

Try this (I'm assuming you want the result in the active cell?):

Sub IfProc()

If Range("A7") = "Grade2" And Range("B7") = "Grade1" Then
Application.ActiveCell = "OK"
Else
Application.ActiveCell = "Replace"
End If

End Sub

Best regards

John
 

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

Back
Top