Evaluate using a variable - Help please
I am having some difficulty substituting a variable (LastPRow) in place of
the Number 20 in the code below.
I assumed that if I substituted " & LastPRow & " for 20 it would work
.... but it doesn't.
It returns Error 13, Type Mismatch
TIA for any help you can provide
vba code ..........
With Sheets("Payments")
LastPRow = .Cells(65536, 1).End(xlUp).Row
TextBox11 = Format(Evaluate("SUM(IF(((A2:A20)=""" &
ComboBox2.Value & """)*((B2:B20)=" & CDbl(TextBox4.Text) & "),D1:D10))"),
"#,###.00")
End With
|