-
Knowledge Base Approver
The King of Overkill!
VBAX Master
Hmmm... doesnt seem wrong to me, looks like everything should work fine. Since your calculations are the same in the If and ElseIf, what if you just did:[vba]For Each CLL In Intersect(Qty, ActiveSheet.UsedRange).Cells
'if cell starts with PE, PS, WM, AS, PC, KN, NC, DW, GO, WP, FVDM, FHDM, MDDI
If Not Exclude(UCase(Left(Intersect(CLL.EntireRow, Nm), 2)), Array("PE", "PS", _
"WM", "AS", "PC", "KN", "NC", "DW", "GO", "WP")) Or Not Exclude(UCase(Left _
(Intersect(CLL.EntireRow, Nm), 4)), Array("FVDM", "FHDM", "MDDI")) Then
If IsNumeric(CLL) Then
vWdth = Intersect(CLL.EntireRow, Wdth).Value
vHght = Intersect(CLL.EntireRow, Hght).Value
If Exclude(UCase(Left(Intersect(CLL.EntireRow, Nm), 2)), Array("WO", "TO", "BO")) Then
Totl2 = Totl2 + CLL.Value * (26 * vHght + 108 * vWdth + vWdth * vHght)
Else
If UCase(Left(Intersect(CLL.EntireRow, Nm), 2)) = "WG" Then
Totl2 = Totl2 + CLL.Value * (26 * vHght + 108 * vWdth + vWdth * vHght)
End If
Totl = Totl + CLL.Value * vWdth * vHght
End If
End If
End If
Next[/vba]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules