Repeated Task Through VBA

  • Dear All
    I could not find a way to make the following formula to be executed through a loop OR other means in Excel 2007 VBA. There are 50 records and the records starts from row 9 till row 58 in the Sheet 20.
    Any suggestions for the code would be highly appreciated.
    Thanks.



  • Re: Repeated Task Through VBA


    Hi loknath


    please try


    Code
    Private Sub CommandButton2_Click()
        Sheets("Sheet20").Range("GV9:GV58").Value = "=IF(GQ9="""","""",IF(AND(DC9>=40,DW9>=40,EF9>=40,SMALL(GS9:GU9,2)>=35,LARGE(GS9:GU9,1)>=40,LARGE(GS9:GU9,1)>=35),""P"",""F""))"
    End Sub
  • Re: Repeated Task Through VBA


    Or the R1C1 version of the formula


    Code
    Range("GV9:GV58").FormulaR1C1 = "=IF(RC[-5]="""","""",IF(AND(RC[-97]>=40,RC[-77]>=40,RC[-68]>=40,SMALL(RC[-3]:RC[-1],2)>=35,LARGE(RC[-3]:RC[-1],1)>=40,LARGE(RC[-3]:RC[-1],1)>=35),""P"",""F""))"


    Thanks

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!