View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Todd Huttenstine[_3_] Todd Huttenstine[_3_] is offline
external usenet poster
 
Posts: 68
Default Repetitive IF THEN Statement

Below is my code:

Sub CalculateProfit()
OrderForm.TextBox119.Value = OrderForm.TextBox9.Value +
OrderForm.TextBox14.Value + OrderForm.TextBox19.Value +
OrderForm.TextBox24.Value + _
OrderForm.TextBox29.Value + OrderForm.TextBox34.Value +
OrderForm.TextBox39.Value + OrderForm.TextBox44.Value + _
OrderForm.TextBox49.Value + OrderForm.TextBox54.Value +
OrderForm.TextBox59.Value + OrderForm.TextBox64.Value + _
OrderForm.TextBox69.Value + OrderForm.TextBox74.Value +
OrderForm.TextBox79.Value + OrderForm.TextBox84.Value + _
OrderForm.TextBox89.Value + OrderForm.TextBox94.Value +
OrderForm.TextBox99.Value + OrderForm.TextBox104.Value + _
OrderForm.TextBox109.Value + OrderForm.TextBox114.Value
End Sub

Here is the problem, if anyone of the above TextBoxes.Value is "Select",
then "Select" will be 1 of the values in TextBox119. Is there anyway I can
remove or ignore all the TextBox.Values that equal "Select" without having
to write a ton of IF THEN statements?


Todd Huttenstine