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 cells in different worksheets

How would I compare cells values one from one sheet one from another.

I tried doing this
sub try()
For aa = 7 To 100 Step 8
For a = 2 To 12 Step 1
If Worksheets("Sheet1").Cells(2, aa) = Worksheets("Coating
Goals").Cells(2, a) Then Worksheets("Sheet1").Cells(2, aa).Font.Bold =
True
If Worksheets("Sheet1").Cells(2, aa) = Worksheets("Coating
Goals").Cells(2, a) Then Cells(2, aa).Font.Color = RGB(0, 0, 255)
Next
Next
End Sub

but this would not do check cell by cell. I want for "Sheet1". cells
(2,7) compare to "Coating Goal". Cells(2,2). Then check Sheet1". cells
(2,15) compare to "Coating Goal". Cells(2,3). so on and so on.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Compare cells in different worksheets

try this instead:
sub try()
aa = 7
For a = 2 To 12 Step 1
If Worksheets("Sheet1").Cells(2, aa) = Worksheets("Coating
Goals").Cells(2, a) Then Worksheets("Sheet1").Cells(2, aa).Font.Bold =
True
If Worksheets("Sheet1").Cells(2, aa) = Worksheets("Coating
Goals").Cells(2, a) Then Cells(2, aa).Font.Color = RGB(0, 0, 255)
aa=aa+8
Next
End Sub


" wrote:

How would I compare cells values one from one sheet one from another.

I tried doing this
sub try()
For aa = 7 To 100 Step 8
For a = 2 To 12 Step 1
If Worksheets("Sheet1").Cells(2, aa) = Worksheets("Coating
Goals").Cells(2, a) Then Worksheets("Sheet1").Cells(2, aa).Font.Bold =
True
If Worksheets("Sheet1").Cells(2, aa) = Worksheets("Coating
Goals").Cells(2, a) Then Cells(2, aa).Font.Color = RGB(0, 0, 255)
Next
Next
End Sub

but this would not do check cell by cell. I want for "Sheet1". cells
(2,7) compare to "Coating Goal". Cells(2,2). Then check Sheet1". cells
(2,15) compare to "Coating Goal". Cells(2,3). so on and so on.


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 cells in different worksheets Mike Excel Worksheet Functions 3 February 19th 09 04:31 PM
compare 2 worksheets for simliar cells and then comb into one work [email protected] Excel Discussion (Misc queries) 1 January 29th 08 01:18 AM
Open two worksheets, then match and compare cells Bob[_15_] Excel Programming 0 August 8th 06 10:21 PM
How do I compare data in two worksheets to find matching cells? Gary Excel Discussion (Misc queries) 4 March 2nd 06 09:04 PM
Compare 2 cells in 2 worksheets, rewrite one of the cells dbomb Excel Programming 1 September 28th 04 09:16 AM


All times are GMT +1. The time now is 11:54 AM.

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

About Us

"It's about Microsoft Excel"