Hi all
Could somebody please tell me where I am going wrong? I am fairly new at vba. Basically I want to be able to click on a certain cell and have a calendar box pop up and enter the date in that cell. I have a few different ranges as to where I need to populate a date.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim Rng1, Rng2, Rng3, Rng4, Rng5, myMultipleRange As Range
Set Rng1 = Range("B2:L2")
Set Rng2 = Range("B8:L8")
Set Rng3 = Range("B11:L11")
Set Rng4 = Range("B16:L16")
Set Rng5 = Range("B18:L18")
Set myMultipleRange = Union(Rng1, Rng2, Rng3, Rng4, Rng5)
If Intersect(Target, myMultipleRange) Is Nothing Then Exit Sub
Cancel = True
UserForm1.Show
End Sub
Thanks
Bookmarks