Gruppe
Druck
Problem
In UserForm-Optionsfelder soll die Seiteneinrichtungsfestlegung für die Orientierung ein und ausgelesen werden.
ClassModule: frmOrientation
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
If optPortrait.Value = True Then
ActiveSheet.PageSetup.Orientation = xlPortrait
Else
ActiveSheet.PageSetup.Orientation = xlLandscape
End If
Unload Me
End Sub
Private Sub UserForm_Initialize()
If ActiveSheet.PageSetup.Orientation = xlPortrait Then
optPortrait.Value = True
Else
optLandscape.Value = True
End If
End Sub
StandardModule: basMain
Sub CallForm()
frmOrientation.Show
End Sub