Private Sub Sel() Selection.Font.Size = 10 End Sub Private Sub Sel2() a = 0 For Each lahter In Selection.Cells If lahter.Value > 1959 And lahter.Value < 1970 Then Cells(3, 4).Value = Selection.Cells.Count a = a + 1 Cells(3, 5).Value = a End If Next lahter End Sub Private Sub Sel3() Cells(4, 4).Value = "Kümnend" Cells(4, 5).Value = "Inimeste arv" Cells(5, 4).Value = 1900 Cells(6, 4).Value = 1910 Cells(7, 4).Value = 1920 Cells(8, 4).Value = 1930 Cells(9, 4).Value = 1940 Cells(10, 4).Value = 1950 Cells(11, 4).Value = 1960 Cells(12, 4).Value = 1970 Cells(13, 4).Value = 1980 Cells(14, 4).Value = 1990 'Cells(15, 4).Value = 2000 a = 0 b = 0 c = 0 d = 0 e = 0 f = 0 g = 0 h = 0 i = 0 j = 0 For Each lahter In Selection.Cells If lahter.Value > 1899 And lahter.Value < 1910 Then 'Cells(5, 4).Value = Selection.Cells.Count a = a + 1 Cells(5, 5).Value = a End If If lahter.Value > 1909 And lahter.Value < 1920 Then b = b + 1 Cells(6, 5).Value = b End If If lahter.Value > 1919 And lahter.Value < 1930 Then c = c + 1 Cells(7, 5).Value = c End If If lahter.Value > 1929 And lahter.Value < 1940 Then d = d + 1 Cells(8, 5).Value = d End If If lahter.Value > 1939 And lahter.Value < 1950 Then e = e + 1 Cells(9, 5).Value = e End If If lahter.Value > 1949 And lahter.Value < 1960 Then f = f + 1 Cells(10, 5).Value = f End If If lahter.Value > 1959 And lahter.Value < 1970 Then g = g + 1 Cells(11, 5).Value = g End If If lahter.Value > 1969 And lahter.Value < 1980 Then h = h + 1 Cells(12, 5).Value = h End If If lahter.Value > 1979 And lahter.Value < 1990 Then i = i + 1 Cells(13, 5).Value = i End If If lahter.Value > 1989 And lahter.Value < 2000 Then j = j + 1 Cells(14, 5).Value = j End If Next lahter End Sub Sub Tabel() Charts.Add ActiveChart.ChartType = xlColumnClustered ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("E5:E14"), PlotBy _ :=xlRows ActiveChart.SeriesCollection(1).XValues = "=Sheet1!R4C4" ActiveChart.SeriesCollection(1).Name = "=Sheet1!R5C4" ActiveChart.SeriesCollection(2).XValues = "=Sheet1!R4C4" ActiveChart.SeriesCollection(2).Name = "=Sheet1!R6C4" ActiveChart.SeriesCollection(3).XValues = "=Sheet1!R4C4" ActiveChart.SeriesCollection(3).Name = "=Sheet1!R7C4" ActiveChart.SeriesCollection(4).XValues = "=Sheet1!R4C4" ActiveChart.SeriesCollection(4).Name = "=Sheet1!R8C4" ActiveChart.SeriesCollection(5).XValues = "=Sheet1!R4C4" ActiveChart.SeriesCollection(5).Name = "=Sheet1!R9C4" ActiveChart.SeriesCollection(6).XValues = "=Sheet1!R4C4" ActiveChart.SeriesCollection(6).Name = "=Sheet1!R10C4" ActiveChart.SeriesCollection(7).XValues = "=Sheet1!R4C4" ActiveChart.SeriesCollection(7).Name = "=Sheet1!R11C4" ActiveChart.SeriesCollection(8).XValues = "=Sheet1!R4C4" ActiveChart.SeriesCollection(8).Name = "=Sheet1!R12C4" ActiveChart.SeriesCollection(9).XValues = "=Sheet1!R4C4" ActiveChart.SeriesCollection(9).Name = "=Sheet1!R13C4" ActiveChart.SeriesCollection(10).XValues = "=Sheet1!R4C4" ActiveChart.SeriesCollection(10).Name = "=Sheet1!R14C4" ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1" With ActiveChart .HasTitle = True .ChartTitle.Characters.Text = "Inimeste arv kümnendis" .Axes(xlCategory, xlPrimary).HasTitle = False .Axes(xlValue, xlPrimary).HasTitle = False End With End Sub Sub Tabel2() Charts.Add ActiveChart.ChartType = xlColumnClustered ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("E5:E14"), PlotBy _ :=xlRows ActiveChart.SeriesCollection(1).XValues = "=Sheet1!R4C4" ActiveChart.SeriesCollection(1).Name = "=Sheet1!R5C4" ActiveChart.SeriesCollection(2).XValues = "=Sheet1!R4C4" ActiveChart.SeriesCollection(2).Name = "=Sheet1!R6C4" ActiveChart.SeriesCollection(3).XValues = "=Sheet1!R4C4" ActiveChart.SeriesCollection(3).Name = "=Sheet1!R7C4" ActiveChart.SeriesCollection(4).XValues = "=Sheet1!R4C4" ActiveChart.SeriesCollection(4).Name = "=Sheet1!R8C4" ActiveChart.SeriesCollection(5).XValues = "=Sheet1!R4C4" ActiveChart.SeriesCollection(5).Name = "=Sheet1!R9C4" ActiveChart.SeriesCollection(6).XValues = "=Sheet1!R4C4" ActiveChart.SeriesCollection(6).Name = "=Sheet1!R10C4" ActiveChart.SeriesCollection(7).XValues = "=Sheet1!R4C4" ActiveChart.SeriesCollection(7).Name = "=Sheet1!R11C4" ActiveChart.SeriesCollection(8).XValues = "=Sheet1!R4C4" ActiveChart.SeriesCollection(8).Name = "=Sheet1!R12C4" ActiveChart.SeriesCollection(9).XValues = "=Sheet1!R4C4" ActiveChart.SeriesCollection(9).Name = "=Sheet1!R13C4" ActiveChart.SeriesCollection(10).XValues = "=Sheet1!R4C4" ActiveChart.SeriesCollection(10).Name = "=Sheet1!R14C4" ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1" With ActiveChart .HasTitle = True .ChartTitle.Characters.Text = "Inimeste arv kümnendis" .Axes(xlCategory, xlPrimary).HasTitle = False .Axes(xlValue, xlPrimary).HasTitle = False End With End Sub