senthil2406
New Member
- Joined
- Jun 15, 2019
- Messages
- 2
Private Sub CommandButton1_Click()
Dim LastRow As Long, LR As Long
For x = 6 To LR
For y = 7 To LastRow
If Sheets("Master").Range("L4") = Sheets("In & Out Data").Cells(y, 5) And Sheets("Master").Range("D6") = Sheets("In & Out Data").Cells(y, 7) Then
Range("L" & x) = WorksheetFunction.SumIf(Sheets("In & Out Data").Range("G7:G1500"), Sheets("Master").Range("D" & x), Sheets("In & Out Data").Range("K7:K1500"))
End If
Next y
Next x
End Sub
Dim LastRow As Long, LR As Long
For x = 6 To LR
For y = 7 To LastRow
If Sheets("Master").Range("L4") = Sheets("In & Out Data").Cells(y, 5) And Sheets("Master").Range("D6") = Sheets("In & Out Data").Cells(y, 7) Then
Range("L" & x) = WorksheetFunction.SumIf(Sheets("In & Out Data").Range("G7:G1500"), Sheets("Master").Range("D" & x), Sheets("In & Out Data").Range("K7:K1500"))
End If
Next y
Next x
End Sub