String array issues. Need help...

  • Thread starter Thread starter John Guderian
  • Start date Start date
J

John Guderian

I have two strings that I am placing into an array, and adding all values
within this array. However I want to add to this a little.

I need for this code to be modified such that when going through the
"billing" array if there is a 0 or empty value, then add the same value from
the "cost" array. Do this until it completes the array. Im not sure how to
modify it to do this. If it cant be modified how can I accomplsih what I
need to do?

Any Idea?

Thanks!

For x = LBound(CostArray) To UBound(CostArray)
If CostArray(x) <> "" Then
FinalCost = FinalCost + CSng(CostArray(x))
End If

Next x

For x = LBound(BillingArray) To UBound(BillingArray)
If BillingArray(x) <> "" Then
FinalBilling = FinalBilling + CSng(BillingArray(x))
End If

Next x
 
I guess that you mean

For x = LBound(BillingArray) To UBound(BillingArray)
If BillingArray(x) = "" Or BillingArray(x) = 0 Then
FinalBilling = FinalBilling + CSng(CostArray(x))
Else
FinalBilling = FinalBilling + CSng(BillingArray(x))
End If
Next x


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Back
Top