A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
In theory at least
Private Sub MultiPage1_Change()
With Me.MultiPage1
Select Case .Value
Case 0: Me.Calendar1.Visible = False
Case 1: Me.Calendar1.Visible = True
End Select
End With
End Sub
should work, but I know from previous experience that calendar controls do not always behave as expected when you attempt to hide them, so an alternative approach is to move them off the userform's visible area e.g. assuming the userform width is (say) 240, put the left property of the control beyond this e.g. 250, then when you want it visible, change its left property back to its original position - here 60. This invariably works where the visibility option doesn't.
It helps to set the userform width in the vba editor wide enough to display the moved control, and set the width to its normal state in the userform initialization.
Private Sub MultiPage1_Change()
With Me.MultiPage1
Select Case .Value
Case 0: Me.Calendar1.Left = 250
Case 1: Me.Calendar1.Left = 60
End Select
End With
End Sub