Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there any way to check and highlight the entire row rather than a column
I want to find out if any entries in my expense databse have been entered twice, because the totals do not add up. Dylan "Leith Ross" wrote: Hello SITCFanTN, Add a VBA module to your Workbook and paste the macro code below into it. Code: -------------------- Sub HighlightDuplicates() 'Highlight duplicates in Yellow Dim Cell As Range Dim Cell_Range As Range Dim MyCollection As New Collection 'Find last cell entry in the row LastEntry = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Address 'Define the range to examine Set Cell_Range = ActiveSheet.Range("B1", LastEntry) For Each Cell In Cell_Range On Error Resume Next MyCollection.Add Item:="1", Key:=Cell.Text If Err.Number = 457 Then Cell.Interior.ColorIndex = 6 Err.Clear End If Next Cell End Sub -------------------- Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=557160 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I highlight duplicates from 2 rows using set criteria | Excel Discussion (Misc queries) | |||
Highlight rows if duplicates are found | Excel Worksheet Functions | |||
Highlight Duplicates with different Color | Excel Discussion (Misc queries) | |||
Highlight Duplicates, Macro? | Excel Worksheet Functions | |||
How do i locate/highlight duplicates ? | Excel Discussion (Misc queries) |