📄 form7.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{65E121D4-0C60-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCHRT20.OCX"
Begin VB.Form Form7
BorderStyle = 1 'Fixed Single
Caption = "收支统计报表"
ClientHeight = 6705
ClientLeft = 150
ClientTop = 435
ClientWidth = 10905
Icon = "Form7.frx":0000
LinkTopic = "Form7"
MaxButton = 0 'False
MDIChild = -1 'True
ScaleHeight = 6705
ScaleWidth = 10905
Begin MSComDlg.CommonDialog CommonDialog1
Left = 10800
Top = 7680
_ExtentX = 847
_ExtentY = 847
_Version = 393216
CancelError = -1 'True
DefaultExt = "xls"
DialogTitle = "选择导出路径及文件名"
Filter = "EXCEL文件|*.xls"
End
Begin MSComctlLib.ProgressBar ProgressBar1
Height = 255
Left = 960
TabIndex = 14
Top = 6360
Visible = 0 'False
Width = 9855
_ExtentX = 17383
_ExtentY = 450
_Version = 393216
BorderStyle = 1
Appearance = 0
End
Begin VB.Frame Frame2
Height = 5415
Left = 120
TabIndex = 11
Top = 840
Width = 10695
Begin MSChart20Lib.MSChart MSChart1
Height = 5055
Left = 120
OleObjectBlob = "Form7.frx":0442
TabIndex = 12
Top = 240
Width = 10455
End
End
Begin MSAdodcLib.Adodc Adodc2
Height = 330
Left = 3840
Top = 8040
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc2"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 2400
Top = 8040
Visible = 0 'False
Width = 1335
_ExtentX = 2355
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Frame Frame1
Caption = "收支统计"
Height = 735
Left = 120
TabIndex = 0
Top = 120
Width = 10575
Begin VB.CommandButton Command1
Caption = "导出"
Height = 375
Left = 8040
TabIndex = 10
Top = 240
Width = 1095
End
Begin VB.CheckBox Check2
Caption = "月统计"
Height = 255
Left = 4680
TabIndex = 8
Top = 300
Width = 855
End
Begin VB.CommandButton Command3
Cancel = -1 'True
Caption = "退出"
Height = 375
Left = 9240
TabIndex = 7
Top = 240
Width = 1095
End
Begin VB.ComboBox Combo2
Height = 300
Left = 5520
TabIndex = 6
Top = 277
Width = 735
End
Begin VB.CheckBox Check1
Caption = "年统计"
Enabled = 0 'False
Height = 255
Left = 2400
TabIndex = 5
Top = 300
Value = 2 'Grayed
Width = 855
End
Begin VB.CommandButton Command2
Caption = "统计"
Default = -1 'True
Height = 375
Left = 6840
TabIndex = 4
Top = 240
Width = 1095
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "Form7.frx":44EF
Left = 3240
List = "Form7.frx":44F1
TabIndex = 3
Top = 277
Width = 975
End
Begin VB.OptionButton Option2
Caption = "收入统计"
Height = 255
Left = 1200
TabIndex = 2
Top = 300
Width = 1095
End
Begin VB.OptionButton Option1
Caption = "支出统计"
Height = 255
Left = 120
TabIndex = 1
Top = 300
Value = -1 'True
Width = 1095
End
End
Begin MSAdodcLib.Adodc Adodc4
Height = 330
Left = 2520
Top = 0
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc4"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc Adodc3
Height = 330
Left = 3720
Top = 0
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc3"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "执行进度"
Height = 180
Left = 120
TabIndex = 13
Top = 6390
Width = 720
End
Begin VB.Label Label1
Alignment = 2 'Center
ForeColor = &H000000FF&
Height = 375
Left = 3840
TabIndex = 9
Top = 2280
Width = 3495
End
End
Attribute VB_Name = "Form7"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim dd(10) As Currency '保存金额变量
Dim ii As Integer '类型循环变量
Dim iii As Integer '月份循环变量
Dim zlx(1 To 10) As String '数组内容
Dim i As Integer '数组上标
Dim cap As String '保存唯一选项是哪一个
Dim mon As String '定义月分变量
Dim tj1(1 To 31, 1 To 10) '每日与类型金额变量
Dim tj(1 To 12, 1 To 10) '月分与类型金额变量
Dim sz As String '收或支变量
Dim chek As Integer '上次统计状态变量
Dim mo As Integer '是月统计还是日统计
Dim sftj As Integer '判断是否有过一次统计
Dim path As String '导出路径
Dim xl As Object ' OLE自动化对象
Dim pr1 As Integer
Dim pr As Integer
Dim lx1 As Integer
Dim lxhe(1 To 10)
Dim lxhe1, lxhe2 As Integer
Private Sub Command1_Click()
'是否进行统计
If sftj = 0 Then
MsgBox "您必须先进行统计才能导出!"
Exit Sub
End If
On Error GoTo er
'选择导出路径
CommonDialog1.FileName = MSChart1.TitleText
CommonDialog1.ShowSave
er:
If err.Number = 32755 Then
Exit Sub
End If
'保存文件路径及名字
Dim path As String
path = CommonDialog1.FileName
pr = 1
pr1 = 1
Set xl = CreateObject("Excel.Sheet.8")
'合并第一行表格
xl.Worksheets(1).Range("A1:J1").mergecells = True
'表头标题
xl.Worksheets(1).cells(1, 1).Value = " " & MSChart1.TitleText
xl.Worksheets(1).Rows(1).Font.ColorIndex = 5 '字体为蓝色
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -