Dim Cell As Range, D(), Radku As Long, HDN As String, RNG As Range
With wsUrgence
Radku = .Cells(Rows.Count, 1).End(xlUp).Row - 1
If Radku < 2 Then MsgBox "Chybějí data.", vbExclamation, "Oznam": Exit Sub
HDN = wsStrategickeDily.Cells(3, 4).Value2
ReDim D(1 To Radku, 1 To 1)
D = .Cells(2, 1).Resize(Radku).Value2
For Radku = 1 To Radku
If D(Radku, 1) = HDN Then
If RNG Is Nothing Then Set RNG = .Cells(Radku + 1, 1) Else Set RNG = Union(RNG, .Cells(Radku + 1, 1))
End If
Next Radku
End With
If Not RNG Is Nothing Then RNG.Interior.Color = RGB(0, 204, 255)
End Sub
Nechcete Vy náhodou testovať výskyt všetkých zo Strategické díly!D3:D13 ? Inak to môžete kľudne aj Podmieneným formátom.
PS: wsUrgence a wsStrategickeDily som si pomenoval CodeName listov.citovat