Sub intervalli(lab_1 As Range, ByVal n As Integer)
Worksheets(1).Activate
Worksheets(2).Cells(1, 1).Value = Application.WorksheetFunction.Min(lab_1.Value)
int_1 = Application.WorksheetFunction.Max(lab_1.Value) - Application.WorksheetFunction.Min(lab_1.Value)
int_2 = int_1 / n
For i = 2 To n + 1 Step 1
Worksheets(2).Cells(i, 1).Value = Worksheets(2).Cells(i - 1, 1).Value + int_2
Next i
********Worksheets(2).Range.FormulaArray = Application.WorksheetFunction.Frequency(lab_1.Value, Worksheets(2).Active.Cells)*****
End Sub
Sub main()
Dim dset As Range
Set dset = Range("A1 : A100")
Dim step As Integer
Dim n As Integer
step = Val(InputBox("quanti intervalli vuoi?"))
Call intervalli(Range(dset.Cells(3, 2), dset.Cells(100, 2)), step)
MsgBox ("Elaborazione Terminata")
End Sub
|