Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat. The purpose of this eBook is to educate the reader about ransomware attacks.
Public Sub CalculateYTDCustomerSalesAndMargins() Dim UniqueCustomers, Output, Claimbacks As Variant Dim i, c, j, k, z As Double UniqueCustomers = Range("UniqueCustomers") Claimbacks = Range("ClaimBacks") ReDim Output(1 To UBound(UniqueCustomers), 1 To 5) j = 0 'Sales variable k = 0 'Cost of sales variable z = 0 'Claim backs variable For c = 1 To UBound(UniqueCustomers) For i = 1 To UBound(Claimbacks) If UniqueCustomers(c, 2) = Claimbacks(i, 5) Then j = j + Claimbacks(i, 11) * Claimbacks(i, 10) k = k + Claimbacks(i, 12) * Claimbacks(i, 10) z = z + Claimbacks(i, 22) Output(c, 1) = j Output(c, 2) = k Output(c, 3) = 1 - k / j Output(c, 4) = z Output(c, 5) = 1 - (k - z) / j End If Next i j = 0 'Sales variable k = 0 'Cost of sales variable z = 0 'Claim backs variable Next c Range("E2", Range("I" & UBound(UniqueCustomers) + 1)) = Output End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|The formula is too long formulas should not be longer than 8192 characters||9||55|
|what program/tool is used to create charts like this?||4||30|
|compare column in an Excel spreadsheet.||1||38|
|Checking references in VBA||3||22|