Monthview date picked placed in each cell of table column, instead of only in the selected cell:
I have a monthview userform that “pops up” when any cell in a given range in a table is double clicked. It is supposed to put the picked date in the selected cell, unfortunately I could not get that to work. At the moment it place the picked date in all cells of the given range!
In the code in the form “frmPopUpCalendar” module:
Option Explicit
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
On Error Resume Next
ThisWorkbook.Worksheets("Intersect Table Column").ListObjects("Table15").ListColumns(3).DataBodyRange.Value = DateClicked
Unload Me
End Sub
I want to replace the line
ThisWorkbook.Worksheets("Intersect Table Column").ListObjects("Table15").ListColumns(3).DataBodyRange.Value = DateClicked
which puts the selected date in all of the cells of the selected column
with the following line,
ThisWorkbook.Worksheets("Intersect Table Column").ActiveCell.Value = DateClicked
so as to only put the date in the selected cell, but when I do that nothing gets written in the cell??!!
The code of sheet “Intersect Table Column”:
Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, ActiveSheet.ListObjects("Table15").ListColumns(3).DataBodyRange) Is Nothing Then
Call OpenPopUpCalendar
Application.Goto Target.Offset(0, -1)
End If
End Sub
In a normal module the following code:
Sub OpenPopUpCalendar()
frmPopUpCalendar.Show
End Sub
Regards,
Henk
Bookmarks