Gruppe
Format
Problem
Über eine UserForm-Schaltfläche wird der Zahlenformatierungsdialog aufgerufen und der Bereich C1:D12 gemäß der Formatauswahl formatiert.
ClassModule: frmFormat
Dim sFormat As String
Private Sub cmdCancel_Click()
ActiveCell.NumberFormat = sFormat
Unload Me
End Sub
Private Sub cmdFormat_Click()
sFormat = ActiveCell.NumberFormat
Application.Dialogs(xlDialogFormatNumber).Show
End Sub
Private Sub cmdOK_Click()
Range("C1:D12").NumberFormat = ActiveCell.NumberFormat
ActiveCell.NumberFormat = sFormat
Unload Me
End Sub
Private Sub UserForm_Initialize()
Range("A1").Select
End Sub
StandardModule: Modul1
Sub DialogAufruf()
frmFormat.Show
End Sub