hier in VBA
10.11.2009 08:32:05
Matthias
Hallo
Hättest gleich schreiben können das Du VBA brauchst.
Bsp.
Datum steht in A1
Option Explicit
Sub WochentagVBA()
Dim Rng As Range
Set Rng = Range("A1")
If IsDate(Rng) Then
Rng.Activate 'optional (nicht notwendig)
Select Case Weekday(CDate(Rng), vbMonday)
Case Is = 7
MsgBox "Sonntag", , Rng.Value
Case Is = 1
MsgBox "Monteg", , Rng.Value
Case Is = 2
MsgBox "Dienstag", , Rng.Value
Case Is = 3
MsgBox "Mittwoch", , Rng.Value
Case Is = 4
MsgBox "Donnerstag", , Rng.Value
Case Is = 5
MsgBox "Freitag", , Rng.Value
Case Is = 6
MsgBox "Samstag", , Rng.Value
End Select
Else
MsgBox "Es steht kein gültiges Datum in A1", vbCritical
End If
Set Rng = Nothing
End Sub
Gruß Matthias