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

📄 frm关口电量.frm

📁 县级电力调度管理信息系统。VB6.0开发。 DMIS调度子系统包括以下功能模块:调度操作票管理、调度运行日志、调度交接班管理、调度值班管理、调度报表管理、调度文档、避峰拉闸限电管理等7个业务模块。
💻 FRM
📖 第 1 页 / 共 5 页
字号:
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
    With sendexcel.ActiveCell.Characters(Start:=2, Length:=8).Font
        .Name = "Times New Roman"
        .FontStyle = "常规"
        .Size = 12
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
    With sendexcel.ActiveCell.Characters(Start:=10, Length:=1).Font
        .Name = "宋体"
        .FontStyle = "常规"
        .Size = 12
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
    sendexcel.Range("C3:G3").Select
    sendexcel.ActiveCell.FormulaR1C1 = "止          码"
    With sendexcel.ActiveCell.Characters(Start:=1, Length:=1).Font
        .Name = "宋体"
        .FontStyle = "常规"
        .Size = 12
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
    With sendexcel.ActiveCell.Characters(Start:=2, Length:=10).Font
        .Name = "Times New Roman"
        .FontStyle = "常规"
        .Size = 12
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
    With sendexcel.ActiveCell.Characters(Start:=12, Length:=1).Font
        .Name = "宋体"
        .FontStyle = "常规"
        .Size = 12
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
    sendexcel.Range("H3:L3").Select
    sendexcel.ActiveCell.FormulaR1C1 = "起          码"
    With sendexcel.ActiveCell.Characters(Start:=1, Length:=1).Font
        .Name = "宋体"
        .FontStyle = "常规"
        .Size = 12
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
    With sendexcel.ActiveCell.Characters(Start:=2, Length:=10).Font
        .Name = "Times New Roman"
        .FontStyle = "常规"
        .Size = 12
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
    With sendexcel.ActiveCell.Characters(Start:=12, Length:=1).Font
        .Name = "宋体"
        .FontStyle = "常规"
        .Size = 12
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
    sendexcel.Range("M3:Q3").Select
    sendexcel.ActiveCell.FormulaR1C1 = "表          码"
    With sendexcel.ActiveCell.Characters(Start:=1, Length:=1).Font
        .Name = "宋体"
        .FontStyle = "常规"
        .Size = 12
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
    With sendexcel.ActiveCell.Characters(Start:=2, Length:=10).Font
        .Name = "Times New Roman"
        .FontStyle = "常规"
        .Size = 12
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
    With sendexcel.ActiveCell.Characters(Start:=12, Length:=1).Font
        .Name = "宋体"
        .FontStyle = "常规"
        .Size = 12
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
    sendexcel.Range("S3:W3").Select
    sendexcel.ActiveWindow.ScrollColumn = 14
    sendexcel.ActiveCell.FormulaR1C1 = "电量"
    sendexcel.Range("S3:W3").Select
    sendexcel.ActiveCell.FormulaR1C1 = "电          量"
    With sendexcel.ActiveCell.Characters(Start:=1, Length:=1).Font
        .Name = "宋体"
        .FontStyle = "常规"
        .Size = 12
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
    With sendexcel.ActiveCell.Characters(Start:=2, Length:=10).Font
        .Name = "Times New Roman"
        .FontStyle = "常规"
        .Size = 12
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
    With sendexcel.ActiveCell.Characters(Start:=12, Length:=1).Font
        .Name = "宋体"
        .FontStyle = "常规"
        .Size = 12
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
    sendexcel.Range("T9").Select
    sendexcel.ActiveWindow.ScrollColumn = 5
    sendexcel.ActiveWindow.ScrollColumn = 1
        sendexcel.Range("A2:W2").Select
    sendexcel.Selection.Merge
    With sendexcel.Selection
        .HorizontalAlignment = xlRight
        .VerticalAlignment = xlCenter
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .ShrinkToFit = False
        .MergeCells = True
    End With
    sendexcel.ActiveWindow.LargeScroll ToRight:=1
    
b(0) = "止码"
b(1) = "起码"
b(2) = "表码"
b(3) = "电量"
If RS.State Then
   RS.Close
End If

sql1 = "select * from xdgl_jsb where type='关口' and jlff='入'"
Set RS = ZHCX.Execute(sql1, 1)
    j = 5
If Not RS.EOF Then
sendexcel.Cells(1, 1).Value = RS(0) + Format(DTPicker1.Value, "yyyy-mm-dd") + "日(有功)电量统计报表"
Do While Not RS.EOF

    sendexcel.Cells(j, 1).Value = Trim(RS("jlgk"))
    sendexcel.Cells(j, 2).Value = Trim(RS("jlff"))
    sendexcel.Cells(j, 18).Value = Trim(RS("bl"))
    For i = 0 To 3
        sql1 = "select * from xdgl_ddyb_rdl where rq='" & DTPicker1.Value & "' and dllx='" & b(i) & "' and gk='" & Trim(RS("jlgk")) & "'"
        Set RS1 = ZHCX.Execute(sql1, 1)
        Select Case i
        Case 0

            Do While Not RS1.EOF
                sendexcel.Cells(j, 3).Value = RS1("d_1")
                sendexcel.Cells(j, 4).Value = RS1("d_2")
                sendexcel.Cells(j, 5).Value = RS1("d_3")
                sendexcel.Cells(j, 6).Value = RS1("d_4")
                sendexcel.Cells(j, 7).Value = RS1("d_z")
                RS1.MoveNext
            Loop
        Case 1
            Do While Not RS1.EOF
                sendexcel.Cells(j, 8).Value = RS1("d_1")
                sendexcel.Cells(j, 9).Value = RS1("d_2")
                sendexcel.Cells(j, 10).Value = RS1("d_3")
                sendexcel.Cells(j, 11).Value = RS1("d_4")
                sendexcel.Cells(j, 12).Value = RS1("d_z")
                RS1.MoveNext
            Loop
  
       Case 2
                        sendexcel.Cells(j, 13).Value = "=c" & CStr(j) & "-h" & CStr(j) & ""
                        sendexcel.Cells(j, 14).Value = "=d" & CStr(j) & "-i" & CStr(j) & ""
                        sendexcel.Cells(j, 15).Value = "=e" & CStr(j) & "-j" & CStr(j) & ""
                        sendexcel.Cells(j, 16).Value = "=f" & CStr(j) & "-k" & CStr(j) & ""
                        sendexcel.Cells(j, 17).Value = "=g" & CStr(j) & "-l" & CStr(j) & ""
          
       Case 3
                        sendexcel.Cells(j, 19).Value = "=m" & CStr(j) & "*r" & CStr(j) & ""
                        sendexcel.Cells(j, 20).Value = "=n" & CStr(j) & "*r" & CStr(j) & ""
                        sendexcel.Cells(j, 21).Value = "=o" & CStr(j) & "*r" & CStr(j) & ""
                        sendexcel.Cells(j, 22).Value = "=p" & CStr(j) & "*r" & CStr(j) & ""
                        sendexcel.Cells(j, 23).Value = "=q" & CStr(j) & "*r" & CStr(j) & ""
        End Select
        If RS1.State Then
            RS1.Close
        End If
    Next i
    RS.MoveNext
    j = j + 1
   Loop
End If
If Err Then Err.Clear
If RS.State Then
   RS.Close
End If
sendexcel.Cells(j, 1).Value = "小计"
sendexcel.Cells(j, 2).Value = "入"
sendexcel.Cells(j, 2).Value = "入"
sendexcel.Cells(j, 19).Value = "=sum(s5:s" & CStr(j - 1) & ")"
sendexcel.Cells(j, 20).Value = "=sum(t5:t" & CStr(j - 1) & ")"
sendexcel.Cells(j, 21).Value = "=sum(u5:u" & CStr(j - 1) & ")"
sendexcel.Cells(j, 22).Value = "=sum(v5:v" & CStr(j - 1) & ")"
sendexcel.Cells(j, 23).Value = "=sum(w5:w" & CStr(j - 1) & ")"
j = j + 1
temp = j - 1
sql1 = "select * from xdgl_jsb where type='关口' and jlff='出'"
Set RS = ZHCX.Execute(sql1, 1)
If Not RS.EOF Then
Do While Not RS.EOF

    sendexcel.Cells(j, 1).Value = Trim(RS("jlgk"))
    sendexcel.Cells(j, 2).Value = Trim(RS("jlff"))
    sendexcel.Cells(j, 18).Value = Trim(RS("bl"))
    For i = 0 To 3
        sql1 = "select * from xdgl_ddyb_rdl where rq='" & DTPicker1.Value & "' and dllx='" & b(i) & "' and gk='" & Trim(RS("jlgk")) & "'"
        Set RS1 = ZHCX.Execute(sql1, 1)
        Select Case i
        Case 0

            Do While Not RS1.EOF
                sendexcel.Cells(j, 3).Value = RS1("d_1")
                sendexcel.Cells(j, 4).Value = RS1("d_2")
                sendexcel.Cells(j, 5).Value = RS1("d_3")
                sendexcel.Cells(j, 6).Value = RS1("d_4")
                sendexcel.Cells(j, 7).Value = RS1("d_z")
                RS1.MoveNext
            Loop
        Case 1
            Do While Not RS1.EOF
                sendexcel.Cells(j, 8).Value = RS1("d_1")
                sendexcel.Cells(j, 9).Value = RS1("d_2")
                sendexcel.Cells(j, 10).Value = RS1("d_3")
                sendexcel.Cells(j, 11).Value = RS1("d_4")
                sendexcel.Cells(j, 12).Value = RS1("d_z")
                RS1.MoveNext
            Loop
  
       Case 2
                        sendexcel.Cells(j, 13).Value = "=c" & CStr(j) & "-h" & CStr(j) & ""
                        sendexcel.Cells(j, 14).Value = "=d" & CStr(j) & "-i" & CStr(j) & ""
                        sendexcel.Cells(j, 15).Value = "=e" & CStr(j) & "-j" & CStr(j) & ""
                        sendexcel.Cells(j, 16).Value = "=f" & CStr(j) & "-k" & CStr(j) & ""
                        sendexcel.Cells(j, 17).Value = "=g" & CStr(j) & "-l" & CStr(j) & ""
          
       Case 3
                        sendexcel.Cells(j, 19).Value = "=m" & CStr(j) & "*r" & CStr(j) & ""
                        sendexcel.Cells(j, 20).Value = "=n" & CStr(j) & "*r" & CStr(j) & ""
                        sendexcel.Cells(j, 21).Value = "=o" & CStr(j) & "*r" & CStr(j) & ""
                        sendexcel.Cells(j, 22).Value = "=p" & CStr(j) & "*r" & CStr(j) & ""
                        sendexcel.Cells(j, 23).Value = "=q" & CStr(j) & "*r" & CStr(j) & ""
        End Select
        If RS1.State Then
            RS1.Close
        End If
    Next i
    RS.MoveNext
    j = j + 1
   Loop
End If
If Err Then Err.Clear
If RS.State Then
   RS.Close
End If
If temp <> (j - 1) Then
    sendexcel.Cells(j, 1).Value = "小计"
    sendexcel.Cells(j, 2).Value = "出"
    sendexcel.Cells(j, 19).Value = "=sum(s" & CStr(temp + 1) & ":s" & CStr(j - 1) & ")"
    sendexcel.Cells(j, 20).Value = "=sum(t" & CStr(temp + 1) & ":t" & CStr(j - 1) & ")"
    sendexcel.Cells(j, 21).Value = "=sum(u" & CStr(temp + 1) & ":u" & CStr(j - 1) & ")"
    sendexcel.Cells(j, 22).Value = "=sum(v" & CStr(temp + 1) & ":v" & CStr(j - 1) & ")"
    sendexcel.Cells(j, 23).Value = "=sum(w" & CStr(temp + 1) & ":w" & CStr(j - 1) & ")"
    j = j + 1
    sendexcel.Cells(j, 1).Value = "合计"
    sendexcel.Cells(j, 2).Value = ""
    sendexcel.Cells(j, 19).Value = "=s" & CStr(temp) & "-s" & CStr(j - 1) & ""
    sendexcel.Cells(j, 20).Value = "=t" & CStr(temp) & "-t" & CStr(j - 1) & ""
    sendexcel.Cells(j, 21).Value = "=u" & CStr(temp) & "-u" & CStr(j - 1) & ""
    sendexcel.Cells(j, 22).Value = "=v" & CStr(temp) & "-v" & CStr(j - 1) & ""
    sendexcel.Cells(j, 23).Value = "=w" & CStr(temp) & "-w" & CStr(j - 1) & ""
    j = j + 1

Else
    sendexcel.Cells(j, 1).Value = "合计"
    sendexcel.Cells(j, 2).Value = ""
    sendexcel.Cells(j, 19).Value = "=s" & CStr(temp)
    sendexcel.Cells(j, 20).Value = "=t" & CStr(temp)
    sendexcel.Cells(j, 21).Value = "=u" & CStr(temp)
    sendexcel.Cells(j, 22).Value = "=v" & CStr(temp)
    sendexcel.Cells(j, 23).Value = "=w" & CStr(temp)
    j = j + 1
End If
    sendexcel.Columns("C:W").Select
    sendexcel.Selection.ColumnWidth = 8
    sendexcel.Columns("A:A").ColumnWidth = 8
    sendexcel.Columns("B:B").ColumnWidth = 8
    s_a = "A1:w" & CStr(j - 1)
    sendexcel.Range(s_a).Select
    sendexcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    sendexcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone

⌨️ 快捷键说明

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