Hi,
i have attached parts of my code which is not doing properly as i am not sure which part of it is wrong.
Sub Histogram(YearFrom, YearTo, ET, BL)
Dim lastrowBis, rowBis, ff, fi, YF, YT, fo As Long
Dim netlossamtis As Currency
lastrowBis = 0
lastrowBis = ActiveWorkbook.Sheets("Data").UsedRange.Rows.Count
For rowBis = 2 To lastrowBis
fi = (YearTo - YearFrom) + 1
fo = ActiveWorkbook.Sheets("Data").Cells(rowBis, 12).Value
ff = (fo * fi) 'suppose to multiply fo and fi
netlossamtis = ActiveWorkbook.Sheets("Data").Cells(rowBis, 13).Value
Select Case netlossamtis
Case 0.01 To 1000#
a = a + ff
Case 1000.01 To 2000#
b = b + ff
Case 2000.01 To 3000#
c = c + ff
Case 3000.01 To 4000#
d = d + ff
........ End Select...
........ Next rowBis...
It does not seems to be able to calculate ff
http://www.mrexcel.com/board2/viewto...364790#1364790
Bookmarks