Thread: Adding in loop
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.charting
Sally Mae Sally Mae is offline
external usenet poster
 
Posts: 16
Default Adding in loop

I have a macro that now adds in a strange fashion. It used to work but now
for some reason the adding in one loop is wrong. When there are decimal
numbers in the cells that the loop is to add the program just puts them
together so that there are several decimal commas. The code is:

For l = 1 To i - 1
dblSumMarketValue = dblSumMarketValue + rng5.Offset(l, 0).Value
Next

For l = 1 To i - 1
dblSumMarketValueBench = dblSumMarketValueBench + rng6.Offset(l,
0).Value
Next

The last loop is the one having the problem. It used to work but now it just
puts the number together. The contents of the cells are pasted in from
another program and are then checked by a function that remove blanks (dont
know if that has any impact..). Please help me if you can!