


How to use the date control to select and insert a date in a certain cell in Excel 2003
Urgent how to use the date control to click and insert a date in a certain cell in Excel2003
In order to help those players who have not successfully passed the level, let us learn about the specific puzzle solving methods. For Excel2007, we can use VBA to solve the problem. The following are the specific steps:
1. Open Excel, click the "Development Tools" tab, in the "Controls" group, find and click "Insert", in the drop-down list, click "Other Controls" in the lower right corner, as shown below:
2. In the pop-up "Other Controls" dialog box, drag the scroll bar to the bottom, select "Calendar Control 12.0" with the left mouse button, and click "OK"
3. Return to the worksheet, drag out a calendar control with the left mouse button, and adjust the size and position, as shown below:
4. Double-click the "Calendar Control" with the left mouse button to bring up the VBA editor, copy and paste the following code into it
Private Sub Calendar1_Click()
ActiveCell = Format(Calendar1.Value, "yyyy-mm-dd")
Me.Calendar1.Visible = False
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 Then
If Target.Row > 1 Then
With Me.Calendar1
.Visible = True
.Top = Target.Top Target.Height
.Left = Target.Left Target.Width
.Value = Date
End With
Else
Me.Calendar1.Visible = False
End If
Else
Me.Calendar1.Visible = False
End If
End Sub
Where "If Target.Column = 1 Then
If Target.Row > 1 Then "Click on the first column, column A, except for the first row, to pop up the calendar control. You can make changes as needed, and then close the VBA code editor and return to the worksheet
5. Click the left mouse button on A2 to pop up the "Calendar Control". Click the date to be entered on the "Control" as needed
Implementing multiple columns using date controls in EXCEL
Private Sub DTPicker1_Change()
ActiveCell.Value = DTPicker1.Value
DTPicker1.Visible = False
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Me.DTPicker1
If Target.count=1 then
If Target.Column = 1 And Target.Column =5 Then
.Visible = True
.Width = Target.Width 15
.Left = Target.Left
.Top = Target.Top
.Height = Target.Height
Else
.Visible = False
End If
else
.Visible = False
end if
End With
End Sub
How to set up multi-column DTP time control in Excel table
After many experiments, using this code, I can use the calendar control on columns 1 and 2 at the same time, and clicking other columns will not appear.
Private Sub Calendar1_Click()
ActiveCell = Calendar1.Value
Me.Calendar1.Visible = False
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column 1 Then (meaning less than and including 2 columns and not including the first row)
Me.Calendar1.Visible = True
Else
Me.Calendar1.Visible = False (clicking other columns will not appear)
End If
End Sub
The above is the detailed content of How to use the date control to select and insert a date in a certain cell in Excel 2003. For more information, please follow other related articles on the PHP Chinese website!

This tutorial explores various methods for combining Excel sheets, catering to different needs: consolidating data, merging sheets via data copying, or merging spreadsheets based on key columns. Many Excel users face the challenge of merging multipl

This tutorial shows you how to quickly calculate simple moving averages in Excel, using functions to determine moving averages over the last N days, weeks, months, or years, and how to add a moving average trendline to your charts. Previous articles

This tutorial demonstrates various methods for calculating averages in Excel, including formula-based and formula-free approaches, with options for rounding results. Microsoft Excel offers several functions for averaging numerical data, and this gui

This tutorial shows you two simple ways to calculate weighted averages in Excel: using the SUM or SUMPRODUCT function. Previous articles covered basic Excel averaging functions. But what if some values are more important than others, impacting the f

This tutorial demonstrates how to efficiently locate and modify data within Excel spreadsheets using the Find and Replace function. We'll cover basic and advanced techniques, including wildcard searches and modifications across multiple workbooks. W

This Excel charting tutorial provides a comprehensive guide to creating and customizing graphs within Microsoft Excel. Learn to visualize data effectively, from basic chart creation to advanced techniques. Everyone uses Excel charts to visualize dat

After you have created a chart in Excel, what's the first thing you usually want to do with it? Make the graph look exactly the way you've pictured it in your mind! In modern versions of Excel, customizing charts is easy and fun. Microsof

This tutorial demonstrates the Excel REPLACE and SUBSTITUTE functions with practical examples. Learn how to use REPLACE with text, numbers, and dates, and how to nest multiple REPLACE or SUBSTITUTE functions within a single formula. Last week, we ex


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Chinese version
Chinese version, very easy to use

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool
