Calendar Input

B

Brian Matlack

Hi!
I have a userform calendar that I want to input a date with. What I
want is:

1. The form to remain visible while I select another cell to input to.
2. The input cell must be in the range "Dates"

This is the code in the userform. This code does not work.
< code start >
Option Explicit
Private Sub Calendar1_Click()

ActiveCell.NumberFormat = "mm/dd/yyyy"
If ActiveCell.Address = Range("Dates") Then
ActiveCell.Value = Calendar1.Value
Else
Exit Sub
End If
End Sub
< code stop >

Any help or direction would be appreciated! Thanks!
 
G

Guest

Option Explicit
Private Sub Calendar1_Click()
ActiveCell.NumberFormat = "mm/dd/yyyy"
If not Intersect(ActiveCell,Range("Dates")) is nothing then
ActiveCell.Value = Calendar1.Value
End if
End sub
 
B

Brian Matlack

Thanks Tom! The code works Great! I'll keep working on the problem with
keeping the userform visible while I select a different cell.
Thanks again!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top