当前位置: 首页 > wzjs >正文

c2c网站的主要功能学校网站怎么做推广方案

c2c网站的主要功能,学校网站怎么做推广方案,网站黑链代码,圣都装饰的口碑怎么样Sub statistical_data() Dim lastRow As Long 每个sheet的最后一行 Dim i As Long, j As Long Dim ws As Worksheet 按照任务紧急程度_紧急重要,重要不紧急,紧急不重要,不紧急不重要 作为key统计计划用时,和时间用时 …

Sub statistical_data()
    Dim lastRow As Long '每个sheet的最后一行
    Dim i As Long, j As Long
    Dim ws As Worksheet
    
    '按照任务紧急程度_紧急重要,重要不紧急,紧急不重要,不紧急不重要 作为key统计计划用时,和时间用时
    Dim emergency_dict As Object
    Set emergency_dict = CreateObject("Scripting.Dictionary")
    '按照任务分类平台作为KEY,统计 统计计划用时,和时间用时
    Dim task_dict As Object
    Set task_dict = CreateObject("Scripting.Dictionary")
    
    
    '定义要存储的数组 0存放计划用时,1存放实际用时
    Dim time_date(0 To 1) As Single
    Dim emergency_key As String, type_key As String
    Dim key As Variant
    'Dim col_max As Integer, countcol As Integer
    
    
    ' 设置目标工作表和列
    Set ws = ThisWorkbook.ActiveSheet   ' 修改为你的工作表名称
    
    
    Dim nums_of_columns As Long
    Dim row_max As Long, start_row As Long
    
    '最大的列
    nums_of_columns = ws.UsedRange.Columns.Count + 1
    row_max = ws.Range("D65535").End(xlUp).Row
    
    For i = 1 To row_max
     If ws.Range("D" & i) = "紧急程度" Then
        start_row = i + 1
        Exit For
     End If
    Next
    
    Dim task_countrow As Long, emergency_countrow As Long, emergency_start_row As Long, task_start_row As Long
    Dim emergency_end_row As Long, task_end_row As Long
    
    emergency_countrow = start_row + 1
    emergency_start_row = start_row + 1
    task_countrow = start_row + 7
    task_start_row = start_row + 7
    
    Dim plan_col As Long, actual_col As Long, result_col As Long, emergency_col As Long, type_col As Long
    For j = 2 To nums_of_columns
      If ws.Cells(start_row - 1, j) = "紧急程度" Then
        emergency_col = j
       End If
       
       If ws.Cells(start_row - 1, j) = "分类" Then
         type_col = j
       End If
       
      If ws.Cells(start_row - 1, j) = "计划投入时间(小时)" Then
        plan_col = j
      End If
    
      
      If ws.Cells(start_row - 1, j) = "实际投入时间(小时)" Then
         actual_col = j
      End If
       
       '按照紧急程度统计,写入数据的列
       If ws.Cells(start_row - 1, j) = "按照紧急程度统计" Then
          result_col = j
          Exit For
       End If
    Next
    
    Dim result_str_start As String, result_str_end As String, chart_end_col As String
    result_str_start = CNtoW(result_col)
    result_str_end = CNtoW(result_col + 3)
    chart_end_col = CNtoW(result_col + 2)
    
     
    
    
    Dim tempArray(0 To 1) As Single
    Application.ScreenUpdating = False
    '进行统计分析
    Dim emergency_string As String, type_string As String
    Dim plan_time As Single, actual_time As Single
    For i = start_row To row_max
        ' 在这里处理每一行的数据
        emergency_string = ws.Cells(i, emergency_col)
        type_string = ws.Cells(i, type_col)
        plan_time = CSng(ws.Cells(i, plan_col))
        actual_time = CSng(ws.Cells(i, actual_col))
        
        emergency_key = emergency_string
        type_key = type_string
        
        '查找emergency_dict字典是否存在
        If emergency_dict.Exists(emergency_key) Then
                '存在原来数据读出进行累加
                tempArray(0) = emergency_dict(emergency_key)(0) + plan_time
                tempArray(1) = emergency_dict(emergency_key)(1) + actual_time
                emergency_dict(emergency_key) = tempArray
        Else
               '不存在进行初始化
               time_date(0) = plan_time
               time_date(1) = actual_time
               emergency_dict.Add emergency_key, time_date
        End If
            
        '查找task_dict字典是否存在
        If task_dict.Exists(type_key) Then
                '存在原来数据读出进行累加
                tempArray(0) = task_dict(type_key)(0) + plan_time
                tempArray(1) = task_dict(type_key)(1) + actual_time
                task_dict(type_key) = tempArray
         Else
               '不存在进行初始化
               time_date(0) = plan_time
               time_date(1) = actual_time
               task_dict.Add type_key, time_date
        End If
        
    
    Next
    
    
    '清除历史残留,按照紧急程度的统计
    ws.Select
    Range(result_str_start & emergency_countrow & ":" & result_str_end & emergency_countrow + 3).Select
    Selection.ClearContents
    
    Dim task_row_max As Long
    '清除历史残留,按照任务统计
    task_row_max = ws.Range(result_str_start & 65535).End(xlUp).Row
   
    If task_row_max > task_countrow Then
        Dim startCell As String, endCell As String
        startCell = result_str_start & task_countrow
        endCell = result_str_end & (task_countrow + 3)
        
        ' 直接清除内容,避免使用Select/Selection
        ws.Range(startCell & ":" & endCell).ClearContents
    End If
    
    ' 删除工作表中的图表对象(嵌入式图表)
    For Each chartObj In ws.ChartObjects
        chartObj.Delete
    Next chartObj
    
    
   
    '数据写入
    Dim total_plan_times As Single, total_actual_times As Single
    total_plan_times = 0#
    total_actual_times = 0#
    For Each key In emergency_dict.Keys
       ws.Cells(emergency_countrow, result_col) = key
       total_plan_times = total_plan_times + emergency_dict(key)(0)
       ws.Cells(emergency_countrow, result_col + 1) = emergency_dict(key)(0)
       total_actual_times = total_actual_times + emergency_dict(key)(1)
       ws.Cells(emergency_countrow, result_col + 2) = emergency_dict(key)(1)
       ws.Cells(emergency_countrow, result_col + 3) = emergency_dict(key)(1) - emergency_dict(key)(0)
       emergency_countrow = emergency_countrow + 1
    Next key
    ws.Cells(start_row - 1, result_col + 1) = total_plan_times
    ws.Cells(start_row - 1, result_col + 2) = total_actual_times
    emergency_end_row = emergency_countrow - 1
    
   
    
    totalrow = start_row + 5
    For Each key In task_dict.Keys
       ws.Cells(task_countrow, result_col) = key
       ws.Cells(task_countrow, result_col + 1) = task_dict(key)(0)
       ws.Cells(task_countrow, result_col + 2) = task_dict(key)(1)
       ws.Cells(task_countrow, result_col + 3) = task_dict(key)(1) - task_dict(key)(0)
       task_countrow = task_countrow + 1
    Next key
    ws.Cells(totalrow, result_col + 1) = total_plan_times
    ws.Cells(totalrow, result_col + 2) = total_actual_times
    task_end_row = task_countrow - 1
    
    
    '画二维饼图
    Dim startDate As Date
    Dim emergency_chart_title As String, task_chart_title As String
    startDate = ThisWorkbook.ActiveSheet.Cells(1, 5).Value
    emergency_chart_title = "按照紧急程度统计时间使用情况" & FormatDateToNumeric(startDate)
    task_chart_title = "按照任务分类统计时间使用情况" & FormatDateToNumeric(startDate)
    '按照紧急程度统计时间图表
    'CreatePieChartWithCategoryLabels(start_col As String, end_col As String, start_row As Long, end_row As Long, chart_title As String)
    CreatePieChartWithCategoryLabels result_str_start, chart_end_col, emergency_start_row, emergency_end_row, emergency_chart_title
    CreatePieChartWithCategoryLabels result_str_start, chart_end_col, task_start_row, task_end_row, task_chart_title
    Application.ScreenUpdating = True
    
    MsgBox "The statistical time is completed."

End Sub


文章转载自:

http://aRqRIvO9.kfLbf.cn
http://T7OiY2ya.kfLbf.cn
http://7zucVNRd.kfLbf.cn
http://cSKauOAi.kfLbf.cn
http://3CRVTo8F.kfLbf.cn
http://QSVa9s5t.kfLbf.cn
http://NDeelx4x.kfLbf.cn
http://WOc6FzLK.kfLbf.cn
http://fgrj5Y9c.kfLbf.cn
http://R8sJFSMY.kfLbf.cn
http://Wnd2WVG7.kfLbf.cn
http://NvzqLiBN.kfLbf.cn
http://XqjUcbY5.kfLbf.cn
http://HNzg7dPx.kfLbf.cn
http://07KBq2sw.kfLbf.cn
http://nFdyGnn4.kfLbf.cn
http://ykOxdn5P.kfLbf.cn
http://y3ZiAINM.kfLbf.cn
http://namEspL9.kfLbf.cn
http://oDX86sWp.kfLbf.cn
http://JIZOME5I.kfLbf.cn
http://A7PFJ5E4.kfLbf.cn
http://IV2ULAak.kfLbf.cn
http://TvMFw9xN.kfLbf.cn
http://dQndSXgA.kfLbf.cn
http://GfWaw0VI.kfLbf.cn
http://RhDE5W36.kfLbf.cn
http://4pI13g7m.kfLbf.cn
http://cFoIegit.kfLbf.cn
http://GuxLBV9u.kfLbf.cn
http://www.dtcms.com/wzjs/761099.html

相关文章:

  • 怎么为网站做外链如何做网站建设方案
  • 阿里云网站建设方案书中山市上海建设人才网证书查询
  • 谷城网站开发扁平化设计 网站
  • 汽车行业网站建设方案html网站开发心得
  • 网站建设都需要哪些东西淘宝客网站要备案吗
  • 上海企业信息查询商城网站 不易优化
  • 网站开发集成工具成都网站推广营销
  • 黄冈网站优化公司哪家好进入百度首页
  • 站牛网是做什么的setnet科技网站建设
  • 怎样做一个自己的网站做网站的市场有那么大吗
  • 如何做产品网站网页设计风机网站怎么做
  • 网站更换程序网站底部版权怎么做
  • 自建网站教程视频wordpress各个文件
  • 扁平化设计网站 源码建站之星7大核心价值
  • 怎么在微信公众号上做网站餐饮网站建设思路
  • 网站设计和营销山东省城乡和住房建设厅网站
  • 建站快车用户登录校园app开发费用
  • 哪个网站可以做结婚证深圳最大的软件开发公司
  • 长沙企业网站优化淄博专业做网站
  • 江苏省交通厅门户网站建设管理开发工具eclipse
  • 免费行情软件网站大全入口个人网页设计模板网站
  • 金融做网站wordpress拷站
  • 北京想象力网站建设wordpress实现自动重定向
  • 论坛申请网站备案前置审批中英网站建立
  • 做公众好号的网站吗建设国际互联网网站
  • 建设企业网站管理系统目的dw网页设计作品简单
  • jsp网站模版公司官网源码下载
  • 聚焦伟业网站怎么做推广专做药材的网站有哪些
  • 沂水县住房和建设局网站wordpress 维基插件
  • 桐乡城市建设局网站做竞赛的平台或网站