Thread: Compare sheets
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] carlos_ray86@hotmail.com is offline
external usenet poster
 
Posts: 67
Default Compare sheets

I have two sheets and they both have data in them. I'm trying to
compare them and if they are the same then turn the font red. I tried
this but nothing happens.

Dim sht1 As Worksheet, sht2 As Worksheet

Set sht1 = Worksheets("Sheet1")
Set sht2 = Worksheets("Ctg Sheet")

If sht1.Range("f2") = sht2.Range("f22") Then
sht1.Range("F2").Font.Color = 3

End