Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
Hi,
I have the text "Enter date here" in cell C1. A user needs to override this with a date before clickling a button on the sheet to run a macro. How can I add code to this button to ensure that a date is entered? That is, if they forget to enter a date, I would like a box to pop up reminding them to enter one. Thanks Rob |
#2
![]() |
|||
|
|||
![]()
Try something like:
Private Sub CommandButton1_Click() If Not IsDate([C1].Value) Then MsgBox "Please enter a date in C1!" [C1].Value = "Enter date here" Exit Sub Else 'Rest of code here End If End Sub --- HTH Jason Atlanta, GA -----Original Message----- Hi, I have the text "Enter date here" in cell C1. A user needs to override this with a date before clickling a button on the sheet to run a macro. How can I add code to this button to ensure that a date is entered? That is, if they forget to enter a date, I would like a box to pop up reminding them to enter one. Thanks Rob . |
#3
![]() |
|||
|
|||
![]()
Thanks Jason - that works perfectly!
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Simple But Stumped | Excel Discussion (Misc queries) | |||
New Excel user needs help with simple Macro... | New Users to Excel | |||
Ploting dates against a calendar and not as a simple events | Charts and Charting in Excel | |||
Simple formula doesn't quite add up | Excel Discussion (Misc queries) | |||
Simple, Monday morning brain function | Excel Worksheet Functions |