Hello again,
I have created I nice little Addin (with matt's help) that calculates the sqr ft of a job multiplies the total by a finish factor and calculates the interior based on a default formula if the name starts with "WG" My code looks like this:
[VBA]Private Sub cmdQuote_Click()
Dim CLL As Range, Totl As Double, Qty As Range, Wdth As Range, Hght As Range
Dim Nm As Range, Totl2 As Double, vWdth As Double, vHght As Double
Set Qty = Columns("C")
Set Wdth = Columns("F")
Set Hght = Columns("G")
Set Nm = Columns("D")
For Each CLL In Intersect(Qty, ActiveSheet.UsedRange).Cells
If IsNumeric(CLL) Then
vWdth = Intersect(CLL.EntireRow, Wdth).Value
vHght = Intersect(CLL.EntireRow, Hght).Value
If UCase(Left(Intersect(CLL.EntireRow, Nm), 2)) = "WO" 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
Next
With lblTotl
.Caption = Totl
End With
With lblTotl2
.Caption = Totl2
End With
' MsgBox "Totl: " & Totl & vbCrLf & "Totl2: " & Totl2 & vbCrLf & "txtFinish: " & txtFinish.Value
txtQuoteTotal.Value = (Totl / 144 + Totl2 / 144) * txtFinish.Value
txtQuoteTotal.Value = Format(txtQuoteTotal.Value, "$###,##0.00")
End Sub[/VBA]
Now I would like to create a list of names that would not be considered in my loop through the items or would have a zero total if included in the loop.
Can I write a function and call it exclude() and then simply write a list of strings to check for and then if they loop finds this name Totl = 0 for that item??
Or is it more complex than this??