das ist bestimmt eine leichte Aufgabe für Euch:
Ich möchte in einen definierten Bereich (A16:I20) prüfen, ob ein Text oder eine Zahl eingetragen ist.
Wenn nicht, soll eine Fehlermeldung erscheinen.
Wie kann ich das machen?
Danke.
Viele Grüße
Marco
A | B | C | D | E | F | G | H | I | |
13 | 44 | FALSCH | |||||||
14 | 45 | WAHR | |||||||
15 | |||||||||
16 | 16x | #DIV/0! | 16x | 16x | 16x | 16x | 16x | 16x | 16x |
17 | 17x | 17x | 17x | 17x | 17x | 17x | 17x | 17x | 17x |
18 | 18x | 18x | 18x | 18x | 18x | 18x | 18x | 18x | 18x |
19 | 19x | 19x | 19x | 19x | 19x | 19x | 19x | 19x | 19x |
20 | 20x | 20x | 20x | 20x | 20x | 20x | 20x | 20x | 20x |
Formeln der Tabelle | ||||||||||||
|
A | B | C | D | E | F | G | H | I | |
13 | 44 | FALSCH | |||||||
14 | 45 | WAHR | |||||||
15 | |||||||||
16 | 16x | #DIV/0! | 16x | 16x | 16x | 16x | 16x | 16x | 16x |
17 | 17x | 17x | 17x | 17x | 17x | 17x | 17x | 17x | 17x |
18 | 18 | 18 | 18 | 18 | 18 | 18 | 18 | 18 | 18 |
19 | 19x | 19x | 19x | 19x | 19x | 19x | 19x | 19x | 19x |
20 | 20x | 20x | 20x | 20x | 20x | 20x | 20x | 20x | 20x |
Formeln der Tabelle | ||||||||||||
|
Sub Makro2()
If Evaluate("=SUMPRODUCT(--ISTEXT(A16:I20))+SUMPRODUCT(--ISNUMBER(A16:I20))")
Rückmeldung wäre nett! - Grüße von Erich aus Kamp-Lintfort
Sub Zählen()
Dim anzTexte As Long
Dim anzZahlen As Long
Dim Meldung As String
With Range("A16:I20")
On Error Resume Next
anzTexte = .SpecialCells(xlCellTypeConstants, 2).Cells.Count
anzZahlen = .SpecialCells(xlCellTypeConstants, 2).Cells.Count
On Error GoTo 0
Meldung = "Zellen gesamt: " & .Cells.Count & Chr(10)
Meldung = Meldung & "davon Texte: " & anzTexte & Chr(10)
Meldung = Meldung & "davon Zahlen: " & anzZahlen & Chr(10)
End With
MsgBox Meldung
End Sub
Gruß, Daniel
Sub t()
If Application.CountA([A16:I20]) = 0 Then
MsgBox "Leer"
Else
MsgBox Application.CountA([A16:I20]) & " Einträge"
End If
End Sub
mfg Horst