AW: Bettenbelegung
24.09.2006 21:13:27
ramses
Hallo
das wäre der Tabellenaufbau
Tabelle2
| A | B | C | D | E | F | G |
1 | | | | | | | |
2 | | Bettenbelegung | | | | |
3 | | von | bis | | | | |
4 | | 01.09.2006 | 18.09.2006 | | Einzelbettbelegung | 18 | |
5 | | | | | Zweibettbelegung | 8 | |
6 | | | | | Dreibettbelegung | 3 | |
7 | | | | | | | |
8 | | | | | | | |
9 | 1. Bett | 2.Bett | 3.Bett | | | | |
10 | 01.09.2006 | | | | | | |
11 | 02.09.2006 | | | | | | |
12 | 03.09.2006 | | | | | | |
13 | 04.09.2006 | | | | | | |
14 | 05.09.2006 | | | | | | |
15 | 06.09.2006 | | | | | | |
16 | 07.09.2006 | | | | | | |
17 | 08.09.2006 | | | | | | |
18 | 09.09.2006 | 09.09.2006 | | | | | |
19 | 10.09.2006 | 10.09.2006 | | | | | |
20 | 11.09.2006 | 11.09.2006 | 11.09.2006 | | | | |
21 | 12.09.2006 | 12.09.2006 | 12.09.2006 | | | | |
22 | 13.09.2006 | 13.09.2006 | 13.09.2006 | | | | |
23 | 14.09.2006 | | 14.09.2006 | | | | |
24 | 15.09.2006 | | 15.09.2006 | | | | |
25 | 16.09.2006 | | 16.09.2006 | | | | |
26 | 17.09.2006 | | | | | | |
27 | 18.09.2006 | | | | | | |
28 | | | | | | | |
29 | | | | | | | |
Excel Tabellen einfach im Web darstellen Excel Jeanie HTML Download
und das der Code hinter der Schaltfläche
Private Sub CommandButton1_Click()
Dim i As Integer
Dim Bett1 As Integer, Bett2 As Integer, Bett3 As Integer
Dim startRow As Integer, endRow As Integer
Dim startDate As Date, endDate As Date, datCol As Integer
'Hier beginnen die Daten
startRow = 10
'In dieser Spalte stehen die Daten
datCol = 1
'Startdatum
startDate = Range("B4")
'EndDatum
endDate = Range("C4")
endRow = Cells(Rows.Count, datCol).End(xlUp).Row
Bett1 = 0
Bett2 = 0
Bett3 = 0
For i = startRow To endRow
If Cells(i, datCol) >= startDate And Cells(i, datCol) <= endDate Then
Bett1 = Bett1 + 1
If IsDate(Cells(i, datCol + 1)) And IsDate(Cells(i, datCol + 2)) Then
Bett2 = Bett2 + 1
Bett3 = Bett3 + 1
ElseIf IsDate(Cells(i, datCol + 1)) Or IsDate(Cells(i, datCol + 2)) Then
Bett2 = Bett2 + 1
End If
End If
Next i
Range("F4") = Bett1
Range("F5") = Bett2
Range("F6") = Bett3
End Sub
Gruss Rainer