AW: Userform über x schließen ohne Aktion
13.05.2023 15:15:35
Ulrike
Hier ist der Code:
Option Explicit
Private Sub Bestätigen_Click()
Unload UserForm
End Sub
Private Sub OptHaushalt_Click()
Dim color As Long
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
If OptHaushalt = True Then
ActiveCell.Interior.color = RGB(200, 200, 200)
ActiveCell.Interior.Pattern = xlSolid
Else
color = RGB(255, 255, 255)
End If
End Sub
Private Sub OptJob_Click()
Dim color As Long
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
If OptJob = True Then
ActiveCell.Interior.color = RGB(180, 200, 230)
ActiveCell.Interior.Pattern = xlSolid
Else
color = RGB(255, 255, 255)
End If
End Sub
Private Sub OptPause_Click()
Dim color As Long
Dim cell As Range
For Each cell In Selection
If OptPause = True Then
cell.Interior.color = RGB(170, 210, 140)
cell.Interior.Pattern = xlLightHorizontal
Else
color = RGB(255, 255, 255)
End If
Next cell
End Sub