Cell changes highlighting

M

MikeCM

I have a worksheet that I am asking a person to review (and only one
reviewer). I'm not keen on using 'track changes' to identify values in
cells, so I would like a macro to run automatically and (at a glance
and with impact) highlight changes by colouring the cell and choosing a
different font colour. Is there anything simple to do this? Thanks.

Mike
 
R

Rawce

Prior to submitting, it'll be easier to make a copy of your sheet and
maybe hide it (Format > Sheet > Hide). If it complains about cells
going over 255 characters, before hiding, select everything on the
original (make sure it's your original!), right click and copy then
select everything on the copied spreadsheet and paste over it.

Then have something like this:

Sub Highlight_Changes()
Dim iStartRow As Integer
Dim iStartCol As Integer
Dim iEndRow As Integer
Dim iEndCol As Integer
Dim sOrigSheet As String
Dim sCheckSheet As String
Dim vOrigCell As Variant
Dim vCheckCell As Variant

' Sets the range of rows you're looking at; this will go from 1 to 5.
iStartRow = 1
iEndRow = 5

' Names the checking sheet (what your checker sees) and the original
data (the hidden one for comparison).
sOrigSheet = "Original"
sCheckSheet = "Checking"

Do While iStartRow <= iEndRow
' Sets the range of cols you're looking at; this will go from A to
C.
iStartCol = 1
iEndCol = 3
Do While iStartCol <= iEndCol
vCheckCell =
ThisWorkbook.Worksheets(sCheckSheet).Cells(iStartRow, iStartCol)
vOrigCell =
ThisWorkbook.Worksheets(sOrigSheet).Cells(iStartRow, iStartCol)
If vCheckCell <> vOrigCell Then
ThisWorkbook.Worksheets(sCheckSheet).Cells(iStartRow,
iStartCol).Select ' Change to Orig if you want to highlight that sheet
instead.
With Selection.Interior
.ColorIndex = 3 ' Change number for a different colour.
End With
End If
iStartCol = iStartCol + 1
Loop
iStartRow = iStartRow + 1
Loop

End Sub

Should work, just change the number of rows/columns (e.g. 26 to go from
A to Z) and sheet titles accordingly.

Cheers,

Ross.
 
A

acampbell012

Change the attributes as needed.

Private Sub Worksheet_Change(ByVal Target As Range)
Target.Font.ColorIndex = 5
Target.Font.Bold = True
Target.Interior.ColorIndex = 8
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top