ik wil 2 cellen in verschillende kolommen kleuren als in de 2e cell de waarde kleiner of gelijk is aan bijvoorbeeld 80
Ik heb het volgende maar kan niet opgeven kleiner of gelijk aan
Dim R As Range, FindAddress As String
Dim I As Integer
'Set initial value of the variable.
I = 9
find_what = "80" Dit moet dus worden kleiner of gelijk aan
'Search for all the occurrences of the item.
With Range("A1:N27")
Set R = .Find(what:=find_what _
, SearchOrder:=xlByColumns)
'If a match is found.
If Not R Is Nothing Then
'Store the address of the cell where the first match is found in a variable.
FindAddress = R.Address
Do
'Color the cell where a match is found orange.
R.Interior.ColorIndex = 46
R.Offset(0, -1).Interior.ColorIndex = 46
'increase value of the variable with 1.
I = I + 1
'Search the next cell with a matching value.
Set R = .FindNext(R)
'Loop as long matches are found, and the address of the cell where a match is found,
'is <> as the address of the cell where the first match is found (FindAddress).
Loop While Not R Is Nothing And R.Address <> FindAddress
End If
End With
'Clear memory.
Set R = Nothing
wat doe ik verkeerd??
Ik heb het volgende maar kan niet opgeven kleiner of gelijk aan
Dim R As Range, FindAddress As String
Dim I As Integer
'Set initial value of the variable.
I = 9
find_what = "80" Dit moet dus worden kleiner of gelijk aan
'Search for all the occurrences of the item.
With Range("A1:N27")
Set R = .Find(what:=find_what _
, SearchOrder:=xlByColumns)
'If a match is found.
If Not R Is Nothing Then
'Store the address of the cell where the first match is found in a variable.
FindAddress = R.Address
Do
'Color the cell where a match is found orange.
R.Interior.ColorIndex = 46
R.Offset(0, -1).Interior.ColorIndex = 46
'increase value of the variable with 1.
I = I + 1
'Search the next cell with a matching value.
Set R = .FindNext(R)
'Loop as long matches are found, and the address of the cell where a match is found,
'is <> as the address of the cell where the first match is found (FindAddress).
Loop While Not R Is Nothing And R.Address <> FindAddress
End If
End With
'Clear memory.
Set R = Nothing
wat doe ik verkeerd??