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

  • 相关阅读:
    第十一周学习总结
    个人冲刺——(六)
    第二阶段冲刺—第二天
    软件工程第十四周总结
    第二阶段冲刺—第一天
    大道至简阅读笔记02
    输入法用户体验评价
    软件工程第十三周总结
    人机交互-水王
    大道至简阅读笔记01
  • 原文地址:https://www.cnblogs.com/yanweichen/p/9128591.html
Copyright © 2011-2022 走看看