I have this code, I dont know how to debug it. It always show Invalid procedure call or argument.
Sub Sumif()
Wk = ThisWorkbook.Name
Call Lastrowssub2
Workbooks(Wk).Worksheets("U-Main").Range("G11") = Application.WorksheetFunction.Sumif(Sheets("U-Detail").Range("J11:J" & LastRows), Sheets("U-Detail").Range("Z11:Z" & LastRows), Sheets("Draft").Cells("C2").Value)
End Sub
If someone can help I would be really grateful!
Sub Sumif()
Wk = ThisWorkbook.Name
Call Lastrowssub2
Workbooks(Wk).Worksheets("U-Main").Range("G11") = Application.WorksheetFunction.Sumif(Sheets("U-Detail").Range("J11:J" & LastRows), Sheets("U-Detail").Range("Z11:Z" & LastRows), Sheets("Draft").Cells("C2").Value)
End Sub
If someone can help I would be really grateful!