excel怎么根据日期弹窗VBA代码excel弹出日期选择
发布网友
发布时间:2024-09-17 09:48
我来回答
共1个回答
热心网友
时间:2024-11-16 10:10
使用如下三段代码可实现:
Private Sub Workbook_Open()If Worksheets(1).Cells(10000, 1) > \"\" And Worksheets(1).Cells(10000, 1) <= Date ThenMsgBox 1End IfEnd SubPrivate Sub CommandButton1_Click()UserForm1.ShowEnd SubPrivate Sub CommandButton1_Click()UserForm1.HideIf IsDate(UserForm1.TextBox1.Text) ThenCells(10000, 1) = UserForm1.TextBox1.TextElseMsgBox \"请输入正确日期\"UserForm1.ShowEnd IfEnd Sub