zoukankan      html  css  js  c++  java
  • vb笔记

    输入窗 mydate = InputBox("请输入日期")
    给单元格赋值 Range("c2") = mydate                     
    消息框 MsgBox ("添加成功")
     
    eles if 实例: '
     Dim mydate
     Dim check
     1: mydate = InputBox("请输入日期")
     check = MsgBox("添加成功", vbYesNo)
     If check = vbYes Then
         Range("c2") = mydate
     Else:
         GoTo 1
     End If
     End Sub
     
    do until 列出所有excel文件 
     Dim myrow As Integer
     Dim myfile As String
     myrow = 1
     myfile = Dir("*.xls*")
     Do Until myfile = ""
         Cells(myrow, 1) = myfile
         myrow = myrow + 1
         myfile = Dir
     Loop
     End Sub
     
    ' selectcase计算星期 Macro Sub selectcase计算星期()
       Dim weeknum As Integer
       Dim mydate As Date
       mydate = CDate(Range("c1"))
       weeknum = Weekday(mydate)
       Select Case weeknum
         Case 1
         MsgBox "星期天"
          Case 2
         MsgBox "星期一"
          Case 3
         MsgBox "星期二"
          Case 4
         MsgBox "星期三"
          Case 5
         MsgBox "星期四"
          Case 6
         MsgBox "星期五"
          Case 7
         MsgBox "星期六"
     Case Else
           MsgBox "计算错误"
         End Select
        
     End Sub
     
    删除批注  Dim ws As Worksheet
         Dim cmt As Comment
         For Each ws In Worksheets
             For Each cmt In ws.Comments
             cmt.Delete
             Next
         Next
     End Sub

  • 相关阅读:
    IntelliJ IDEA ESLint autofix/prettier
    常见电脑屏幕分辨率
    在Vue中使用echarts的两种方式
    升级npm和vue-cli
    挖坑指南:module namespace not found in mapGetters()
    Vuex 是一个专为 Vue.js 应用程序开发的状态管理模式
    如何在Vue项目中调试单个组件
    使用jquery的load方法只加载body之间的内容
    固化分组
    占有优先量词
  • 原文地址:https://www.cnblogs.com/yanweichen/p/9128591.html
Copyright © 2011-2022 走看看