carlymadds
New Member
- Joined
- Apr 18, 2013
- Messages
- 1
Hi I am using the following code behid a simple spreadsheet which I need to enter two different date values (in 2 different columns). However the code only seems to work in 1 column (column 'M') but I would like it to work in columns 'M' and 'R'.
Any idea on how to amend the code please???
Private Sub Calendar1_Click()
ActiveCell.Value = CDbl(Calendar1.Value)
ActiveCell.NumberFormat = "dd/mm/yyyy"
ActiveCell.Select
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Application.Intersect(Range("M1:M1000"), Target) Is Nothing Then
Calendar1.Left = Target.Left + Target.Width - Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
Calendar1.Value = Date
' select Today's date in the Calendar
Else: Calendar1.Visible = False
End If
End Sub
Any idea on how to amend the code please???
Private Sub Calendar1_Click()
ActiveCell.Value = CDbl(Calendar1.Value)
ActiveCell.NumberFormat = "dd/mm/yyyy"
ActiveCell.Select
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Application.Intersect(Range("M1:M1000"), Target) Is Nothing Then
Calendar1.Left = Target.Left + Target.Width - Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
Calendar1.Value = Date
' select Today's date in the Calendar
Else: Calendar1.Visible = False
End If
End Sub