bräuchte mal bitte eure Hilfe:
Wie MARKIERT man per VBA alle Zellen im Bereich G5:K10 deren Inhalt größergleich 1?
Am Ende müssen zwischen 0 u. 30 Zellen MARKIERT sein.
Vielen Dank für eure Lösungsvorschläge
PeTeR
F | G | H | I | J | K | L | |
4 | |||||||
5 | -2 | 0 | 2 | -2 | 1 | ||
6 | 0 | -2 | 0 | 0 | -1 | ||
7 | -2 | -1 | -1 | 1 | 1 | ||
8 | -1 | -2 | 0 | 1 | -1 | ||
9 | 1 | 2 | 0 | -1 | -2 | ||
10 | 0 | 2 | 0 | 0 | 1 | ||
11 |
Sub yyyy()
Dim r As Range, rs As Range
For Each r In Range("g5:k10")
If r >= 1 Then
If rs Is Nothing Then
Set rs = r
Else
Set rs = Union(rs, r)
End If
End If
Next
If Not rs Is Nothing Then rs.Select
End Sub
Gruß
Application.Goto Worksheets("Tabelle1").Range("A1"), True
With Worksheets("Tabelle2").Range("G5:K10")
.Cells.FormulaR1C1 = "=IF(Tabelle1!RC>=1,TRUE,"""")"
.Cells.Formula = .Cells.Value
On Error Resume Next
Worksheets("Tabelle1").Range(.SpecialCells(xlCellTypeConstants, xlLogical).Address).Select
.Clear
On Error GoTo 0
End With
Gruß Gerd