• 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.

VBA Macro

Hello Ahmed
I have downloaded the attachment but I didn't know the required obviously
Please attach the expected results and explain the logic
 
Try this
Code:
Sub Test()
    Dim I As Long
   
    For I = 2 To Cells(Rows.Count, 1).End(xlUp).Row
        If Cells(I, "A") = "F" And Cells(I, "C") = "ST" And Cells(I, "E") = 1 Then
            Cells(I, "B") = 10: Cells(I, "D") = 10000
        ElseIf Cells(I, "A") = "M" And Cells(I, "C") = "AO" And Cells(I, "G") = ">=10 & <20" Then
            Cells(I, "B") = 20: Cells(I, "D") = 10050
        'You can add more criteria in the same way
        End If
    Next I
End Sub
 
Back
Top