zoukankan      html  css  js  c++  java
  • 编写VBA宏生成页面

    概述

    依据详细设计中表设计,借用excel宏编写VBA生成页面。

    特色

    高定制、高效率、兼容所有生成要求、不依赖低耦合、任意Sheet适用

    缺陷

    不支持批量Sheet页生成

    VBA源码

    Sub listPage()
    '
    ' 沫沫金
    ' 生成居民健康档案列表页面,时间: 2017/08/17
    '
    Dim tri As Integer, th, td As String
    '生成表格头
    th = "<tr>"
    td = "<tr>"
    For n = 7 To [D65536].End(xlUp).Row
        '字段说明
        th = th + "<th scope=""col"">" + Cells(n, "D") + "</th>"
        '字典值特殊处理
        If Cells(n, "O") = "" Then
        td = td + "<td>${phealth." + Cells(n, "I") + "}</td>"
        Else
        td = td + "<td><dic:dic type=""" + Cells(n, "O") + """ value=""${phealth." + Cells(n, "I") + "}"" /></td>"
        End If
    Next n
    '拼接一行,扔到空闲列统一拷贝
    Cells(7, "B") = th + "</tr>"
    Cells(8, "B") = td + "</tr>"
    '跳转到指定Sheet
    Sheets(2).Activate
    MsgBox "恭喜你,列表内容生成成功。"
    '
    End Sub
    

    以上,谢谢。有修复缺陷的同仁,可添加微信指导

    by.沫沫金

    于2017-08-17 西安

    祝所有项目人员战斗满满、收获满满、人气满满。
  • 相关阅读:
    Python-函数
    Python-运数符
    Python-条件判断
    Python-变量
    移动端页面布局的那些事儿
    关于ie7下display:inline-block;不支持的解决方案
    SuperSlidev2.1 轮播图片和无缝滚动
    解决xmapp中Apache端口号占用问题
    npm 常用命令详解
    python函数总结
  • 原文地址:https://www.cnblogs.com/zl0828/p/7382349.html
Copyright © 2011-2022 走看看