Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Paste the following formula into E1. If that is not where you
ultimately want it, copy it to the cell you want. =IF(AND(A1=6,B1=21,C1="LW-118"),"Prog+NCE",IF(AND(A13,A1<6,C1="LW-118"),"Mop Up",IF(AND(A1=6,B1<21,C1="LW-118"),"Prog","Incomplete"))) Corinne Ross wrote: Thank you Don I have managed to get the program to behave in the way I want and realised where I was going wrong. But there may be a better way to achieve this and I'd love to learn. It's quite longwinded! Here's my code: Dim StudentStatus As String ActiveCell.FormulaR1C1 = "=AND(RC[-4]=6,RC[-2]=""LW-118"",RC[-3]=21)" If ActiveCell.Value = "True" Then StudentStatus = "Prog + NCE" ActiveCell.Value = StudentStatus ElseIf ActiveCell.Value = "False" Then ActiveCell.FormulaR1C1 = "=AND(RC[-4]3,RC[-4]<6,RC[-2]=""LW-118"")" If ActiveCell.Value = "True" Then StudentStatus = "Mop Up" ActiveCell.Value = StudentStatus ElseIf ActiveCell.Value = "False" Then ActiveCell.FormulaR1C1 = "=AND(RC[-4]=6,RC[-3]<21,RC[-2]=""LW-118"")" If ActiveCell.Value = "True" Then StudentStatus = "Prog" ActiveCell.Value = StudentStatus ElseIf ActiveCell.Value = "False" Then StudentStatus = "Incomplete" ActiveCell.Value = StudentStatus End If End If End If End Sub *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
help with the macro or with the formula | Excel Worksheet Functions | |||
Macro or Formula? | Excel Discussion (Misc queries) | |||
Help with macro or formula | Excel Discussion (Misc queries) | |||
Macro/Formula Help? | Excel Discussion (Misc queries) | |||
Formula to macro...anyone?? | Excel Programming |