Private Sub Workbook_Open() 'Call AutoTime On Error Resume Next Call DeleteAllCharts On Error GoTo 0 End Sub Option Explicit Sub AutoTime() Call PieTime 'Application.OnTime Now + TimeValue("00:00:05"), "AutoTime" End Sub Function PieTime() Range("A1").Select On Error Resume Next Call DeleteAllCharts On Error GoTo 0 Call TimeFormat End Function Function DeleteAllCharts() Dim Chart As ChartObject For Each Chart In ActiveSheet.ChartObjects Chart.Delete Next End Function Function TimeFormat() Dim timeis As String Dim nowtime As String Dim hms(1 To 3, 1 To 24) As Long Dim a As Long Dim h As Long Dim hp As Long Dim href As Long Dim m As Long Dim mref As Long Dim s As Long Dim sref As Long Dim mode As Long Dim roman_num As Variant roman_num = Array("XII", "", "I", "", "II", "", "III", "", "IV", "", "V", "", "VI", "", "VII", "", "VIII", "", "IX", "", "X", "", "XI", "") mode = 12 nowtime = Now() timeis = Trim(Mid$(nowtime, InStr(1, nowtime, " "))) h = Mid$(timeis, 1, InStr(1, timeis, ":") - 1) m = Mid$(timeis, InStr(1, timeis, ":") + 1, InStr(1, timeis, ":") - 1) s = Mid$(timeis, InStrRev(timeis, ":") + 1) 'Debug.Print h, m, s If mode = 24 Then hp = h Else If h > 12 Then h = h - 12 hp = h End If For a = 1 To 24 hms(3, a) = 90 'hrs hms(2, a) = 120 'min hms(1, a) = 150 'sec Next a href = (hp * 2) + 1 If href > 24 Then href = 24 For a = 2 To href: hms(3, a) = 0: Next a mref = Int((m / 10) * 4) + 1 If mref > 24 Then mref = 24 For a = 2 To mref: hms(2, a) = 0: Next a sref = Int((s / 10) * 4) + 1 If sref > 24 Then sref = 24 For a = 2 To sref: hms(1, a) = 0: Next a 'Debug.Print href, mref, sref Call PieCht(0, 330, 0, 330, roman_num, hms) End Function Function PieCht(Lt, Wd, Tp, Ht, xtype, yd) Dim chrt As ChartObject Dim lgd As Legend Dim a As Long Dim b As Long Dim ytype(0 To 23) As Variant Dim st As Variant st = Array("H", "M", "S") Set chrt = Sheets("Sheet1").ChartObjects.Add(Left:=Lt, Width:=Wd, Top:=Tp, Height:=Ht) With chrt.Chart For a = 1 To 3 'hands For b = 0 To 23 ytype(b) = yd(a, b + 1) Next b With .SeriesCollection.NewSeries .Interior.ColorIndex = (a + 2) With .Border .ColorIndex = 2 'white .Weight = xlThick End With .Name = st(a - 1) .XValues = xtype 'numerals .Values = ytype() 'time End With Next a .ChartType = xlRadarFilled .HasTitle = True .ChartTitle.Text = Trim$("pi_time") .Axes(xlValue, xlPrimary).TickLabels.Font.Size = 1 .ChartGroups(1).RadarAxisLabels.Font.Size = 20 Set lgd = .Legend Call legendel(lgd) End With Set chrt = Nothing Set lgd = Nothing End Function Function legendel(lgd) Dim i As Long For i = lgd.LegendEntries.Count To 1 Step -1 On Error Resume Next lgd.LegendEntries(i).Delete On Error GoTo 0 Next End Function