Make a checklist type of thing

Kingchaos64

New Member
Joined
Jan 15, 2021
Messages
46
Office Version
  1. 365
Platform
  1. Windows
I'm wanting to make a list next to a table. I would like that list to automatically check the data in the table and highlight a cell in the list if it matches a cell in the table. It also needs to match Today's date. My table is a column of bus numbers, dates, baggage on, baggage off and so on. There is 20 plus busses a day and it's hard to keep track if Ive entered all the busses for that day or not.
So I would like to make a column List on the side of the table with all the bus numbers and that List would check the table for a bus number plus today's date if found I would like that bus number in the List to highlight.

Is this a possibility?
Any help would be greatly appreciated.

My table headers start on A5 to P5
Data starts A6 to P1000
The Date column is A and the Bus column is B
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Copy and paste your sheet layout using XL2BB would greatly help people to get better understanding.

You want to make a column List on the table side but your table starts from column A?
 
Upvote 0
Copy and paste your sheet layout using XL2BB would greatly help people to get better understanding.

You want to make a column List on the table side but your table starts from column A?
Not at work right now to copy paste sorry.
If it would be better the List could be on Sheet 2 not a column in the table.
Yes my table is in A Column to P Column
 
Upvote 0
This is possible but people need to know how your list to compare and the table look like. Otherwise, they can probably suggest in general. :)
 
Upvote 0
I can't download the XL2BB I think it's a security thing on this business computer. I tired taking a picture but I can't get the file small enough for some reason
 
Upvote 0
Maybe if I write this in a more generic way.
So I'm looking for a formula or Vba that will highlight a set of cells( one cell being a number the other being a date) if a same set of cells is found in a range of data.

I would think it would be a formula in Conditional Formatting that will highlight the matching set.

Let's say R6 down to R20 has today's date in each cell and S6 down to S20 have numbers. I would like them to highlight themselves if a match set is found in the table next the this list. In the table A Column is a list of dates and B Column is a list of numbers.

So if R12 and S12 match A17 and B17, R12 and S12 will automatically highlight and stay that way until the next day when the date formula "Today" in R Column changes all the dates.
 
Last edited by a moderator:
Upvote 0
Let say the Date and Number are in Sheet1 R6~R20 and S6~S20 respectively. The list to compare is in Sheet2 say Date and Number in range A2~Ax and B2~Bx

VBA Code:
Sub HighlightMatch()

Dim cellDate1 As Range, cellDate2 As Range
Dim rngDate1 As Range, rngDate2 As Range
Dim ws1 As Worksheet, ws2 As Worksheet

Set ws1 = ActiveWorkbook.Sheets("Sheet1")
Set ws2 = ActiveWorkbook.Sheets("Sheet2")

Set rngDate1 = ws1.Range("R6", "R20")
Set rngDate2 = ws2.Range("A2", ws2.Cells(ws2.Cells.Rows.Count, "A").End(xlUp))

For Each cellDate2 In rngDate2
    For Each cellDate1 In rngDate1
        If cellDate2 = cellDate1 Then
            If cellDate2.Offset(0, 1) = cellDate1.Offset(0, 1) Then
                cellDate1.Resize(1, 2).Interior.ColorIndex = 6
            End If
        End If
    Next
Next

End Sub
 
Upvote 0
Let say the Date and Number are in Sheet1 R6~R20 and S6~S20 respectively. The list to compare is in Sheet2 say Date and Number in range A2~Ax and B2~Bx

VBA Code:
Sub HighlightMatch()

Dim cellDate1 As Range, cellDate2 As Range
Dim rngDate1 As Range, rngDate2 As Range
Dim ws1 As Worksheet, ws2 As Worksheet

Set ws1 = ActiveWorkbook.Sheets("Sheet1")
Set ws2 = ActiveWorkbook.Sheets("Sheet2")

Set rngDate1 = ws1.Range("R6", "R20")
Set rngDate2 = ws2.Range("A2", ws2.Cells(ws2.Cells.Rows.Count, "A").End(xlUp))

For Each cellDate2 In rngDate2
    For Each cellDate1 In rngDate1
        If cellDate2 = cellDate1 Then
            If cellDate2.Offset(0, 1) = cellDate1.Offset(0, 1) Then
                cellDate1.Resize(1, 2).Interior.ColorIndex = 6
            End If
        End If
    Next
Next

End Sub
Zot thank you so much. I've been playing with this and it's almost perfect. Is there a code I can insert that will remove/clear the highlight when the day changes in the R Column? Right now it stays highlighted even if the dates don't match anymore.
 
Upvote 0
My mistake. You did mentioned about it. It should be like this

VBA Code:
Sub HighlightMatch()

Dim cellDate1 As Range, cellDate2 As Range
Dim rngDate1 As Range, rngDate2 As Range
Dim ws1 As Worksheet, ws2 As Worksheet

Set ws1 = ActiveWorkbook.Sheets("Sheet1")
Set ws2 = ActiveWorkbook.Sheets("Sheet2")

Set rngDate1 = ws1.Range("R6", "R20")
Set rngDate2 = ws2.Range("A2", ws2.Cells(ws2.Cells.Rows.Count, "A").End(xlUp))

For Each cellDate2 In rngDate2
    For Each cellDate1 In rngDate1
        If cellDate2 = cellDate1 Then
            If cellDate2.Offset(0, 1) = cellDate1.Offset(0, 1) Then
                cellDate1.Resize(1, 2).Interior.ColorIndex = 6
            Else
                cellDate1.Resize(1, 2).Interior.ColorIndex = xlNone
            End If
        End If
    Next
Next

End Sub
 
Upvote 0
My mistake. You did mentioned about it. It should be like this

VBA Code:
Sub HighlightMatch()

Dim cellDate1 As Range, cellDate2 As Range
Dim rngDate1 As Range, rngDate2 As Range
Dim ws1 As Worksheet, ws2 As Worksheet

Set ws1 = ActiveWorkbook.Sheets("Sheet1")
Set ws2 = ActiveWorkbook.Sheets("Sheet2")

Set rngDate1 = ws1.Range("R6", "R20")
Set rngDate2 = ws2.Range("A2", ws2.Cells(ws2.Cells.Rows.Count, "A").End(xlUp))

For Each cellDate2 In rngDate2
    For Each cellDate1 In rngDate1
        If cellDate2 = cellDate1 Then
            If cellDate2.Offset(0, 1) = cellDate1.Offset(0, 1) Then
                cellDate1.Resize(1, 2).Interior.ColorIndex = 6
            Else
                cellDate1.Resize(1, 2).Interior.ColorIndex = xlNone
            End If
        End If
    Next
Next

End Sub
I can't get this to work properly. It kind of randomly highlights some and not others that it should. Any ideas? Sorry for being such a bother ?
 
Upvote 0

Forum statistics

Threads
1,214,515
Messages
6,119,973
Members
448,933
Latest member
Bluedbw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top