Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub OverlayCheck()
- Dim roomcell As Range
- For Each roomcell In Worksheets("Rooms").Range("A1:A18")
- Dim room As String
- room = roomcell.Text
- Dim c, nc As Range
- Set nc = Cells.Find(What:=room, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows)
- nc.Activate
- Do
- Set c = nc
- Set nc = Cells.Find(What:=room, After:=ActiveCell, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows)
- nc.Activate
- If nc.Row = c.Row And nc.Column <> c.Column Then
- c.Interior.Color = RGB(255, 192, 0)
- nc.Interior.Color = RGB(255, 192, 0)
- End If
- Loop While nc.Row >= c.Row
- Next roomcell
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement