Nested Ifs VBA, How to

C

cg_tor

Hello, Would anyone show me how to put the ifs statements below in VBA. I
would like the results to show in column AQ:


IF(AND(U2>0,V2=0),"ORF "&R2&" to "&W2,

IF(AND(O2>1,P2>1),"At "&Q2,

IF(AND(O2>1,P2=0),"ORF "&L2&" to "&Q2,

IF(AND(O2=0,P2=0),"Awaiting PUD from "&L2,

IF(AND(O2>1,P2>1),"At "&Q2,

IF(AND(AG2>0,AH2>0),"At "&AI2,

IF(AND(AG2>0,AH2=0),"ORF "&AD2&" to "&AI2,

IF(AND(AA2>0,AB2>0), IF(AND(AA2>0,AB2=0),"ORF "&X2&" to "&AC2,

IF(AND(U2>0,V2>0),"At "&W2,

IF(AND(AM2>0,AN2>0),"At "&AO2,

IF(AND(AM2>0,AN2=0),"ORF "&AJ2&" to "&AO2,"Check"


Thanks in advance
 
B

Barb Reinhardt

One way.

Dim aWS as excel.worksheet
set aWS = Acitvesheet

With aWS.Range("AQ2")
IF aws.range(U2).value = 0 and _
aws.range("V2").value = 0 then
.value = "ORF "&aws.range("R2").value &" to "&aws.range("W2"),value
elseif aws.range(U2).value = 0 and _ 'Repeated the above
aws.range("V2").value = 0 then
.value = "ORF "&aws.range("R2").value &" to "&aws.range("W2"),value
end if
end if


end with
 

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