zoukankan      html  css  js  c++  java
  • vba 新建并保存工作簿

    1、立即窗口显示路径

    msgbox thisworkbook.fullname

     2、新建工作簿并保存

    Sub test()
        Rem============== 新建保存工作簿
        Dim wb As Workbook
        Dim ws As Worksheet
        Dim path, name As String
        
        Set wb = Workbooks.Add  '新建工作簿
        Set ws = wb.Worksheets(1)
        With ws
            .name = "信息表"    '修改工作表的标签名称
            Rem========== 设置表头
            .Range("B1:E1") = Array("id", "name", "sex", "birthday")
        End With
        
        path = ThisWorkbook.path
        name = "员工信息表.xlsx"
        wb.SaveAs path & "" & name  '保存工作簿   
        wb.Close
    End Sub

     

     

     

  • 相关阅读:
    re模块
    collections模块
    hashlib模块
    序列号模块
    random模块
    sys模块
    OS模块
    工厂模式
    Go语言之直接选择排序
    Go语言之直接插入排序
  • 原文地址:https://www.cnblogs.com/shanger/p/12993576.html
Copyright © 2011-2022 走看看