如何添加日期选择器到VBA UserForm [英] How to Add Date Picker To VBA UserForm

查看:2292
本文介绍了如何添加日期选择器到VBA UserForm的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个添加到userForm的控件,以使用户能够选择日期。我在这个地址上是一个好的

I am looking for a control to add to userForm to enable user to pick the date.I a good one at this address

在VBA的文本框中格式化MM / DD / YYYY日期

是完美的,但它生成不可见的纸张,这不是我的应用程序的nessaccary我试图停止创建表,但我无法弄清楚。
你能不能让我知道如何正确修改Siddharth Rout代码,或者把这个代码放在另一个应用程序上?

from Siddharth Rout which is perfect but it generate invisible sheets which is not nessaccary for my application I tried to stop creating sheets but i couldnt figure it out. Can you please let me know how I can properly modified the Siddharth Rout code or ponit me to another application like that?

感谢你的时间

推荐答案

OFFICE 2013说明

Windows 7(x64) | MS Office 32位

(For Windows 7 (x64) | MS Office 32-Bit)

选项1 |检查能力是否存在| 2分钟

Option 1 | Check if ability already exists | 2 minutes


  1. 打开VB编辑器

  2. 工具 - >其他控件

  3. 选择Microsoft Monthview Control 6.0(SP6)(如果适用)

  4. 对VBA Userform使用'DatePicker'控件

  1. Open VB Editor
  2. Tools -> Additional Controls
  3. Select "Microsoft Monthview Control 6.0 (SP6)" (if applicable)
  4. Use 'DatePicker' control for VBA Userform

选项2 | Monthview控件目前不存在| 5分钟

Option 2 | The "Monthview" Control doesn't currently exist | 5 minutes


  1. 关闭 Excel

  2. 下载 MSCOMCT2.cab (它是一个提取到两个有用文件的cabinet文件)

  3. 提取两个文件| .inf文件和.ocx文件

  4. 安装 |右键单击.inf文件|点击安装

  5. 移动 .ocx文件从C:\Windows\system32移动到C:\Windows\sysWOW64

  6. 运行 CMD 开始菜单 - >搜索 - >CMD.exe|右键单击图标|选择以管理员身份运行

  7. 注册 Active-X File |键入regsvr32 c:\windows\sysWOW64\MSCOMCT2.ocx

  8. 打开 Excel |打开VB编辑器

  9. 激活控件|工具 - >参考|选择Microsoft Windows Common Controls 2-6.0(SP6)

  10. Userform 控件|在VB项目|中选择任何用户窗体工具 - >其他控件

  11. 选择Microsoft Monthview Control 6.0(SP6)

  12. strong>'DatePicker'控件为VBA UserForm

  1. Close Excel
  2. Download MSCOMCT2.cab (it's a cabinet file which extracts into two useful files)
  3. Extract Both Files | the .inf file and the .ocx file
  4. Install | right-click the .inf file | hit "Install"
  5. Move .ocx file | Move from "C:\Windows\system32" to "C:\Windows\sysWOW64"
  6. Run CMD | Start Menu -> Search -> "CMD.exe" | right-click the icon | Select "Run as administrator"
  7. Register Active-X File | Type "regsvr32 c:\windows\sysWOW64\MSCOMCT2.ocx"
  8. Open Excel | Open VB Editor
  9. Activate Control | Tools->References | Select "Microsoft Windows Common Controls 2-6.0 (SP6)"
  10. Userform Controls | Select any userform in VB project | Tools->Additional Controls
  11. Select "Microsoft Monthview Control 6.0 (SP6)"
  12. Use 'DatePicker' control for VBA UserForm

好的,这两个步骤中的任一个应该适合你,如果你有Office 2013(32 -Bit)在Windows 7(x64)上。如果您有不同的Windows 7和Windows 7组合,则某些步骤可能会有所不同。 Office 2013。

Okay, either of these two steps should work for you if you have Office 2013 (32-Bit) on Windows 7 (x64). Some of the steps may be different if you have a different combo of Windows 7 & Office 2013.

Monthview控件将是您完全充实的DatePicker。它配备了自己的属性和形象。它工作得很好祝你好运。

The "Monthview" control will be your fully fleshed out 'DatePicker'. It comes equipped with its own properties and image. It works very well. Good luck.

网站:bonCodigo从上面(这是他的工作的更新的扩展)

网站:AMM从上面(这只是增加额外的费用)

网站:各种Microsoft支持网页

Site: "bonCodigo" from above (this is an updated extension of his work)
Site: "AMM" from above (this is just an exension of his addition)
Site: Various Microsoft Support webpages

这篇关于如何添加日期选择器到VBA UserForm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆