• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Formula in VBA

9mmjeep

New Member
I have a VBA imbedded into the sheet so that it automatically will complete a few tasks. The question I have is I am trying to get a formula to work the Formula is

=IF(SUM(IF($E2>=1,1,0),IF($F2>=1,1,0),IF($G2>=1,1,0),IF($H2>=$I2,1,0),IF($I2>=1,1,0),IF($J2>=1,1,0),IF($K2>=1,1,0),IF($L2>=1,1,0),IF($M2>=1,1,0))=9,""YES"",""NO"")

For some reason it will copy it down to the next row but the cells do not change for the Row it remains Row 2

The Code that I have is

Code:
  If Not Intersect(Target, Columns("D")) Is Nothing Then
  If Target.Offset(-1).Value <> "" And Target.Offset(1).Value = "" And Target.Value <> "" Then
  Rows(Target.Offset(1).Row).Hidden = False
  Range("I" & Rows.Count).End(xlUp).Offset(1).Value = "=VLOOKUP(B:B,OPAT!$A$2:$C$143,3,FALSE)"
  Range("N" & Rows.Count).End(xlUp).Offset(1).Value = "=IF(SUM(IF($E2>=1,1,0),IF($F2>=1,1,0),IF($G2>=1,1,0),IF($H2>=$I2,1,0),IF($I2>=1,1,0),IF($J2>=1,1,0),IF($K2>=1,1,0),IF($L2>=1,1,0),IF($M2>=1,1,0))=9,""YES"",""NO"")"

  End If

Like I said it will copy the formula to the next row but will not change there Row

Any help would be greatly appreciated
 
Back
Top