Excel Calendar control Implementation drop-down select Date with VB code implementation

Source: Internet
Author: User

Here are some steps for Excel2016 to select a date by installing the control:

Knowledge Preparation: First understand how to install the control, this part is important, Excel selects the available macros
Https://jingyan.baidu.com/article/6181c3e0ad4144152ef1533f.html

If there is no Calendar control: Microsoft Date and Time picker control (SP6)

Download MSCOMCT2 First

Links: Https://pan.baidu.com/s/1CGV1MBJyBjlqTd7_QFXHqQ
Extract code: mv6z

The administrator runs cmd, and the extracted content (with the action document in the content) is placed in the directory under the C: \ WINDOWS \ SYSWOW64
Execute regsvr32 mscomctl.ocx

32-bit execution under C: \ WINDOWS \system32

Other problem Solving:

After installation found mail control message cannot get properties, errors, etc. can download the following files, and directly execute, close Excel can be used again

Links: Https://pan.baidu.com/s/1wz-0xax9EBax5iEm4ZvsOA
Extract code: XU45

The following is the implementation of VB code

Option explicitprivate Sub dtpicker1_change () ActiveCell.Value = DTPicker1.ValueDTPicker1.Visible = FalseEnd SubPrivate Sub Worksheet_selectionchange (ByVal Target as Range) with Me.dtpicker1if target.column >= 3 and Target.Column <= 4 an D Target.Row >= 3 and Target.count = 1 then    ' OK scope, row and column ADD by xiexinxinclimb 20180930.Value = Date   ' default gets the current date.  Visible = True.width = target.width + 15.Left = Target.Left.Top = Target.Top.Height = Target.HeightElse.Visible = FalseEnd IfEnd WithEnd Sub

If you have help, please recommend!

Excel Calendar control Implementation drop-down select Date with VB code implementation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.