Advertisement
ALTracer

Excel macro: Highlight auditory collisions

Sep 6th, 2017
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub OverlayCheck()
  2. Dim roomcell As Range
  3. For Each roomcell In Worksheets("Rooms").Range("A1:A18")
  4.     Dim room As String
  5.     room = roomcell.Text
  6.     Dim c, nc As Range
  7.     Set nc = Cells.Find(What:=room, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows)
  8.     nc.Activate
  9.     Do
  10.         Set c = nc
  11.         Set nc = Cells.Find(What:=room, After:=ActiveCell, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows)
  12.         nc.Activate
  13.         If nc.Row = c.Row And nc.Column <> c.Column Then
  14.             c.Interior.Color = RGB(255, 192, 0)
  15.             nc.Interior.Color = RGB(255, 192, 0)
  16.         End If
  17.     Loop While nc.Row >= c.Row
  18. Next roomcell
  19. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement