zoukankan      html  css  js  c++  java
  • VBA中的MsgBox函数使用

    1. 首先来看一下MsgBox的基本语法格式:

      MsgBox(prompt[, buttons] [, title] [, helpfile, context])

      下面就其中的各参数进行详细的讲解

      2. prompt参数(必选参数):该参数用于表明输出对话框所显示的内容,由于该参数只代表长度为255个字符的一个字符串,因此我们可以使用“&”连接符将各部分字符串连接起来,同时可以借助函数“Chr(10)”实现换行操作。

      3. Buttons参数(可选参数):用于定义输出窗口的按钮样式及图标显示类型,常见按钮样式如下:

      按钮类型           对应数值     描述

      vbOKOnly               0     只显示 OK 按钮。     

      VbOKCancel             1     显示 OK 及 Cancel 按钮。     

      VbAbortRetryIgnore     2     显示 Abort、Retry 及 Ignore 按钮。     

      VbYesNoCancel          3     显示 Yes、No 及 Cancel 按钮。     

      VbYesNo                4     显示 Yes 及 No 按钮。     

      VbRetryCancel          5     显示 Retry 及 Cancel 按钮。     

      VbCritical            16     显示 Critical Message 图标。     

      VbQuestion            32     显示 Warning Query 图标。     

      VbExclamation         48     显示 Warning Message 图标。     

      VbInformation         64     显示 Information Message 图标。    

      Title参数(可选参数):用于定义在输出窗口标题栏处显示的文本内容

      MsgBox的返回值:该输出框会根据用户所点击的按钮的类型返回对应的常量: 

      常数        值      描述 

      vbOK         1     OK     

      vbCancel     2     Cancel     

      vbAbort      3     Abort     

      vbRetry      4     Retry     

      vbIgnore     5     Ignore     

      vbYes        6     Yes     

      vbNo         7     No    

  • 相关阅读:
    html大文件传输技术
    html大文件传输实例解析
    html大文件传输示例
    ckeditor粘贴word图片自动上传功能
    ckeditor不能粘贴word的问题
    ckeditor不能粘贴word的问题如何解决
    vue-ckeditor-word粘贴
    vue中使用ckeditor,支持wps,word,网页粘贴
    富文本编辑器复制word
    富文本编辑器粘贴word
  • 原文地址:https://www.cnblogs.com/xixislz/p/7416394.html
Copyright © 2011-2022 走看看