Formatting Cells from a list

D

Daniel James

Hi

I am using a macro that I found to search through a column in Excel
and if comparing it to another column in another speadsheet in the
same workbook. If there is a match I have set the macro to highlight
the matching row.

I ideally want to highlight individual cells rather than rows.

Does anyone know how to do this?

Current script as follows:

Sub highlight_cells()

'
' highlight_cells Macro
' Macro recorded 13/01/2004 by Administrator
' Used to compare two lists and highlight matches a particular colour

'

Dim a
For Each a In Sheets("Sheet1").Range("A2:A60")
Sheets("Sheet2").Columns("A:A").Find(What:=a).EntireRow.Interior.ColorIndex
= 3
Next a

End Sub

Any help/suggestions is much appreciated.

Cheers

Daniel
 
B

Bob Phillips

Daniel,

Just remove the .EntireRow property, and then just the found cell gets
coloured.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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