search
HomeSoftware TutorialOffice SoftwareHow to use the date control to select and insert a date in a certain cell in Excel 2003

How to use the date control to select and insert a date in a certain cell in Excel 2003

Jan 07, 2024 pm 12:18 PM
excel2003 time controlHow to use date control in excel2003Implement multiple columns using date controls in excel

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:

How to use the date control to select and insert a date in a certain cell in Excel 2003

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"

How to use the date control to select and insert a date in a certain cell in Excel 2003

3. Return to the worksheet, drag out a calendar control with the left mouse button, and adjust the size and position, as shown below:

How to use the date control to select and insert a date in a certain cell in Excel 2003

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

How to use the date control to select and insert a date in a certain cell in Excel 2003

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

How to use the date control to select and insert a date in a certain cell in Excel 2003

How to use the date control to select and insert a date in a certain cell in Excel 2003

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!

Statement
This article is reproduced at:Excel办公网. If there is any infringement, please contact admin@php.cn delete
Consolidate in Excel: Merge multiple sheets into oneConsolidate in Excel: Merge multiple sheets into oneApr 29, 2025 am 10:04 AM

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

Calculate moving average in Excel: formulas and chartsCalculate moving average in Excel: formulas and chartsApr 29, 2025 am 09:47 AM

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

How to calculate average in Excel: formula examplesHow to calculate average in Excel: formula examplesApr 29, 2025 am 09:38 AM

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

How to calculate weighted average in Excel (SUM and SUMPRODUCT formulas)How to calculate weighted average in Excel (SUM and SUMPRODUCT formulas)Apr 29, 2025 am 09:32 AM

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

Using Excel Find and Replace in the most efficient wayUsing Excel Find and Replace in the most efficient wayApr 29, 2025 am 09:07 AM

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

How to make a chart (graph) in Excel and save it as templateHow to make a chart (graph) in Excel and save it as templateApr 28, 2025 am 09:31 AM

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

Excel charts: add title, customize chart axis, legend and data labelsExcel charts: add title, customize chart axis, legend and data labelsApr 28, 2025 am 09:18 AM

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

Using Excel REPLACE and SUBSTITUTE functions - formula examplesUsing Excel REPLACE and SUBSTITUTE functions - formula examplesApr 28, 2025 am 09:16 AM

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

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SecLists

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

SublimeText3 Chinese version

Chinese version, very easy to use

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool