使用DTP控件输入日期.docxVIP

  • 7
  • 0
  • 约1.69千字
  • 约 3页
  • 2021-01-14 发布于山东
  • 举报
技巧 1 使用 DTP 控件输入日期 在工作表中输入日期可以使用日期时间控件( Microsoft Date and Time Picker Control 6.0 ,简称 DTP 控件)。 在工作表中单击菜单“视图”→“工具栏”→“控件工具箱” ,选择“其他控件”中的 DTP 控件如图 1-1 所示,在工作表中添加一个 DTP 控件。 图 1-1 选择 DTP 控件 在设计模式下双击 DTP 控件写入下面的代码: #001 Private Sub Worksheet_SelectionChange(ByVal Target As Range) #002 With Me.DTPicker1 #003 If Target.Count = 1 And Target.Column = 2 And (Not Target.Row = 1) Or Target.MergeCells Then #004 .Visible = True #005 .Top = Selection.Top #006 .Left = Selection.Left #007 .Height = Selection.Height #008 .Width = Selection.Width #009 If Target.Cells(1, 1) Then #010 .Value = Target.Cell

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档