Ich habe eine Tabelle in der in den Spalten das Datum steht und in der Zeile die Uhrzeit. Gibt es einen Code der anhand des Datums und der Uhrzeit die entsprechende Zelle findet und beschreiben kann?
danke für eure Hilfe
Ulf_MS
Sub matrix()
Dim datum As String
Dim zeit As String
Dim col As Integer
Dim row As Integer
datum = "01.02.2004"
zeit = "14:00"
For Each rng In Range(Range("A1"), Cells(1, 255).End(xlToLeft))
If rng.Value = datum Then col = rng.Column
Next
For Each rng In Range(Range("A1"), Cells(65536, 1).End(xlUp))
If rng.Text = zeit Then row = rng.row
Next
Cells(row, col).Value = "Hallo"
End Sub
Sub matrix()
Dim datum As Date
Dim zeit As Date
Dim col As Integer
Dim rw As Long
datum = CDate("01.02.2004")
zeit = CDate("14:00")
For Each rng In Range(Range("A1"), Cells(1, 255).End(xlToLeft))
If rng.Value = datum Then col = rng.Column
Next
For Each rng In Range(Range("A1"), Cells(65536, 1).End(xlUp))
If rng.Value = zeit Then rw = rng.row
Next
Cells(rw, col).Value = "Hallo"
End Sub