⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clschartwizard.cls

📁 一个用于交警的系统
💻 CLS
📖 第 1 页 / 共 2 页
字号:
        Select Case Index
        Case 0
            .ChartType = 51
        Case 1
            .ChartType = 52
        Case 2
            .ChartType = 53
        Case 3
            .ChartType = 54
        Case 4
            .ChartType = 55
        Case 5
            .ChartType = 56
        Case 6
            .ChartType = -4100
        Case 7
            .ChartType = 57
        Case 8
            .ChartType = 58
        Case 9
            .ChartType = 59
        Case 10
            .ChartType = 60
        Case 11
            .ChartType = 61
        Case 12
            .ChartType = 62
        Case 13
            .ChartType = 4
        Case 14
            .ChartType = 63
        Case 15
            .ChartType = 64
        Case 16
            .ChartType = 65
        Case 17
            .ChartType = 66
        Case 18
            .ChartType = 67
        Case 19
            .ChartType = -4101
        Case 20
            .ChartType = 5
        Case 21
            .ChartType = -4102
        Case 22
            .ChartType = 68
        Case 23
            .ChartType = 69
        Case 24
            .ChartType = 70
        Case 25
            .ChartType = 71
        Case 26
            .ChartType = -4169
        Case 27
            .ChartType = 72
        Case 28
            .ChartType = 73
        Case 29
            .ChartType = 74
        Case 30
            .ChartType = 75
        Case 31
            .ChartType = 1
        Case 32
            .ChartType = 76
        Case 33
            .ChartType = 77
        Case 34
            .ChartType = -4098
        Case 35
            .ChartType = 78
        Case 36
            .ChartType = 79
        Case 37
            .ChartType = -4120
        Case 38
            .ChartType = 80
        Case 39
            .ChartType = -4151
        Case 40
            .ChartType = 81
        Case 41
            .ChartType = 82
        Case 42
            .ChartType = 83
        Case 43
            .ChartType = 84
        Case 44
            .ChartType = 85
        Case 45
            .ChartType = 86
        Case 46
            .ChartType = 15
        Case 47
            .ChartType = 87
        Case 48
            .ChartType = 92
        Case 49
            .ChartType = 93
        Case 50
            .ChartType = 94
        Case 51
            .ChartType = 95
        Case 52
            .ChartType = 96
        Case 53
            .ChartType = 97
        Case 54
            .ChartType = 98
        Case 55
            .ChartType = 99
        Case 56
            .ChartType = 100
        Case 57
            .ChartType = 101
        Case 58
            .ChartType = 102
        Case 59
            .ChartType = 103
        Case 60
            .ChartType = 104
        Case 61
            .ChartType = 105
        Case 62
            .ChartType = 106
        Case 63
            .ChartType = 107
        Case 64
            .ChartType = 108
        Case 65
            .ChartType = 109
        Case 66
            .ChartType = 110
        Case 67
            .ChartType = 111
        Case 68
            .ChartType = 112
        End Select
    End With
    
    On Error GoTo NoExistedError
    If RightYData.Count > 0 Then
        If i = cboSerial.ListIndex + 1 Then
            objExcelApplication.ActiveChart.SeriesCollection(i).Select
            With objExcelApplication.Selection.Border
                .ColorIndex = 1
                .Weight = 1
                .LineStyle = 1
            End With
            objExcelApplication.ActiveChart.SeriesCollection(i).AxisGroup = 2
            Call FormatChart(objExcelApplication, objExcelWorkSheet, "RightY", "Have")
        End If
    End If
    ShowSubChartType = True
    Exit Function
    
NoExistedError:
    Resume Next
    Exit Function
    
SerialError:
    objExcelWorkSheet.ChartObjects(1).Activate
    objExcelApplication.ActiveChart.ChartArea.Select
    With objExcelApplication.ActiveChart
        Select Case Index
        Case 0
            .ChartType = 51
        Case 1
            .ChartType = 52
        Case 2
            .ChartType = 53
        Case 3
            .ChartType = 54
        Case 4
            .ChartType = 55
        Case 5
            .ChartType = 56
        Case 6
            .ChartType = -4100
        Case 7
            .ChartType = 57
        Case 8
            .ChartType = 58
        Case 9
            .ChartType = 59
        Case 10
            .ChartType = 60
        Case 11
            .ChartType = 61
        Case 12
            .ChartType = 62
        Case 13
            .ChartType = 4
        Case 14
            .ChartType = 63
        Case 15
            .ChartType = 64
        Case 16
            .ChartType = 65
        Case 17
            .ChartType = 66
        Case 18
            .ChartType = 67
        Case 19
            .ChartType = -4101
        Case 20
            .ChartType = 5
        Case 21
            .ChartType = -4102
        Case 22
            .ChartType = 68
        Case 23
            .ChartType = 69
        Case 24
            .ChartType = 70
        Case 25
            .ChartType = 71
        Case 26
            .ChartType = -4169
        Case 27
            .ChartType = 72
        Case 28
            .ChartType = 73
        Case 29
            .ChartType = 74
        Case 30
            .ChartType = 75
        Case 31
            .ChartType = 1
        Case 32
            .ChartType = 76
        Case 33
            .ChartType = 77
        Case 34
            .ChartType = -4098
        Case 35
            .ChartType = 78
        Case 36
            .ChartType = 79
        Case 37
            .ChartType = -4120
        Case 38
            .ChartType = 80
        Case 39
            .ChartType = -4151
        Case 40
            .ChartType = 81
        Case 41
            .ChartType = 82
        Case 42
            .ChartType = 83
        Case 43
            .ChartType = 84
        Case 44
            .ChartType = 85
        Case 45
            .ChartType = 86
        Case 46
            .ChartType = 15
        Case 47
            .ChartType = 87
        Case 48
            .ChartType = 92
        Case 49
            .ChartType = 93
        Case 50
            .ChartType = 94
        Case 51
            .ChartType = 95
        Case 52
            .ChartType = 96
        Case 53
            .ChartType = 97
        Case 54
            .ChartType = 98
        Case 55
            .ChartType = 99
        Case 56
            .ChartType = 100
        Case 57
            .ChartType = 101
        Case 58
            .ChartType = 102
        Case 59
            .ChartType = 103
        Case 60
            .ChartType = 104
        Case 61
            .ChartType = 105
        Case 62
            .ChartType = 106
        Case 63
            .ChartType = 107
        Case 64
            .ChartType = 108
        Case 65
            .ChartType = 109
        Case 66
            .ChartType = 110
        Case 67
            .ChartType = 111
        Case 68
            .ChartType = 112
        End Select
    End With
    If RightYData.Count > 0 Then
        Call FormatChart(objExcelApplication, objExcelWorkSheet, "RightY", "Have")
    End If
    ShowSubChartType = True
    Exit Function

ErrMsg:
    ShowSubChartType = False
    Screen.MousePointer = 0
    MsgBox "错误描述: " & Err.Description & vbCrLf & _
           "错误源: " & Err.Source, vbExclamation + vbOKOnly, "系统信息"
End Function
'调整WorkSheet位置
Public Function AdjustWorkSheet(ByVal objExcelApplication As Object, ByVal objExcelWorkSheet As Object, ByVal DSRowsCount As Integer, ByVal DSColsCount As Integer) As Boolean
    On Error Resume Next
    Dim DSRange As String
    Dim ChrCol As String
    
    AdjustWorkSheet = False
    If objExcelWorkSheet Is Nothing Then Exit Function
    Select Case DSColsCount
    Case 1
        ChrCol = "B"
    Case 2
        ChrCol = "C"
    Case 3
        ChrCol = "D"
    Case 4
        ChrCol = "E"
    Case 5
        ChrCol = "F"
    Case 6
        ChrCol = "G"
    End Select
    DSRange = "B4:" & ChrCol & (DSRowsCount + 3)
    '激活WorkSheet
    objExcelWorkSheet.Activate
    '选择区域
    objExcelWorkSheet.Range("A1:I2").Select
    
    objExcelApplication.ActiveWindow.DisplayGridlines = False
    With objExcelApplication.Selection
        .HorizontalAlignment = -4108
        .VerticalAlignment = -4108
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .ShrinkToFit = False
        .MergeCells = True
    End With
    objExcelWorkSheet.Range(DSRange).Select
    With objExcelApplication.Selection
        .HorizontalAlignment = -4108
        .VerticalAlignment = -4108
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .ShrinkToFit = False
        .MergeCells = False
    End With
    objExcelApplication.Selection.Borders(5).LineStyle = -4142
    objExcelApplication.Selection.Borders(6).LineStyle = -4142
    With objExcelApplication.Selection.Borders(7)
        .LineStyle = 1
        .Weight = 2
        .ColorIndex = -4105
    End With
    With objExcelApplication.Selection.Borders(8)
        .LineStyle = 1
        .Weight = 2
        .ColorIndex = -4105
    End With
    With objExcelApplication.Selection.Borders(9)
        .LineStyle = 1
        .Weight = 2
        .ColorIndex = -4105
    End With
    With objExcelApplication.Selection.Borders(10)
        .LineStyle = 1
        .Weight = 2
        .ColorIndex = -4105
    End With
    With objExcelApplication.Selection.Borders(11)
        .LineStyle = 1
        .Weight = 1
        .ColorIndex = -4105
    End With
    With objExcelApplication.Selection.Borders(12)
        .LineStyle = 1
        .Weight = 1
        .ColorIndex = -4105
    End With
    
    DSRange = "B4:" & ChrCol & "4"

    objExcelWorkSheet.Range(DSRange).Select
    objExcelApplication.Selection.Borders(5).LineStyle = -4142
    objExcelApplication.Selection.Borders(6).LineStyle = -4142
    With objExcelApplication.Selection.Borders(7)
        .LineStyle = 1
        .Weight = 2
        .ColorIndex = -4105
    End With
    With objExcelApplication.Selection.Borders(8)
        .LineStyle = 1
        .Weight = 2
        .ColorIndex = -4105
    End With
    With objExcelApplication.Selection.Borders(9)
        .LineStyle = 1
        .Weight = 1
        .ColorIndex = -4105
    End With
    With objExcelApplication.Selection.Borders(10)
        .LineStyle = 1
        .Weight = 2
        .ColorIndex = -4105
    End With
    With objExcelApplication.Selection.Borders(11)
        .LineStyle = 1
        .Weight = 2
        .ColorIndex = 2
    End With
    With objExcelApplication.Selection.Interior
        .ColorIndex = 15
        .Pattern = 1
    End With
    
    objExcelWorkSheet.Range("B4").Select
    objExcelApplication.Selection.Interior.ColorIndex = 14
    objExcelApplication.Selection.Font.ColorIndex = 2
    
    objExcelWorkSheet.ChartObjects(1).Activate
    objExcelWorkSheet.Shapes(1).Left = objExcelWorkSheet.Columns(2).Left
    objExcelWorkSheet.Shapes(1).Top = objExcelWorkSheet.Rows(DSRowsCount + 5).Top
    objExcelWorkSheet.Shapes(1).Width = 380
    objExcelWorkSheet.Shapes(1).Height = 200
    
    AdjustWorkSheet = True
End Function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -