I get this error: "Run-time error '1004'"" Unable to get the Sum property of the Worksheetfunction class
I have a code that looks into multiple comboboxes in a userform and sums their values that the user selects. The code was working fine with only numbers in the combobox list. I recently added one text option into the list and I called it "Not applicable". However, once I run the code I get the above error.
I believe the error is because I introduced the text option, and the sum function in VBA wouldn't recognize it.
Is there anyway to solve this issue?
Thanks
Here is the code I used:
Dim totalscore As Double
totalscore = WorksheetFunction.Sum(frmQA.ComboBox3.Value, frmQA.ComboBox4.Value, frmQA.ComboBox5.Value, frmQA.ComboBox6.Value, frmQA.ComboBox7.Value, frmQA.ComboBox8.Value, frmQA.ComboBox9.Value)