Question : Userform hide/show at Specific range

Hi Experts,

I'm using this code to activate the Calender at range A:A:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Intersect(Target, Range("B:B")) Is Nothing Then
   Calender.Hide
    Else
    Calender.Show False
End If
End Sub

I would to use the same approach for my Userform1 and the target range is, D:D. My current userform1 code is:

Option Explicit
Private Sub CommandButton1_Click()
UserForm1.Show False
End Sub

Private Sub UserForm1_Activate()
UserForm1.SetFocus
End Sub

Please advice how to do this. Attached as well the file for your perusal.
 

Answer : Userform hide/show at Specific range

Then I think you want:

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Intersect(Target, Range("B:B")) Is Nothing Then
   Calender.Hide
      if intersect(target, Range("D:D")) Is nothing then
         ' do nothing
      Else
         userform1.show False
      End If
    Else
    Calender.Show False
End If
End Sub
Random Solutions  
 
programming4us programming4us