Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Compare sheets

try this

Sub test()
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.ColorIndex = 3

End If
End Sub

--


Gary


wrote in message
ups.com...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare two sheets CC Excel Discussion (Misc queries) 0 December 11th 08 03:01 PM
compare two sheets rexmann Excel Discussion (Misc queries) 2 February 14th 07 03:07 PM
Compare 2 sheets Brian Mosher Excel Discussion (Misc queries) 1 March 8th 06 06:04 PM
Compare Sheets wayliff Excel Discussion (Misc queries) 0 January 13th 06 08:14 PM
Compare Sheets wayliff Excel Discussion (Misc queries) 0 January 13th 06 08:14 PM


All times are GMT +1. The time now is 09:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"