LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Match the value and highlight offset

Hello everyone,
Actually I made a solution to my question as below code.However if
"ba" range is larger the code works very slow.Any suggestions?
Thank again
Baha




Sub mark_the_match()
Application.ScreenUpdating = False

Dim r As Range
Dim a As Variant
Dim ba As Range
Set ba = Sheet1.Range("J1:U100") ' if this range is longer,code works
very slow

Sheet1.Select
'Range("B:B").Select
' Columns("B:B").Select
' Selection.Interior.ColorIndex = xlNone
'Sheet1.Select

For Each r In ba
If Application.WorksheetFunction.CountIf(Sheet2.Range ("C:C"), r) = 1
Then
a = a + 1
r.Offset(0, -1).Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
End If
Next r
Sheet1.Range("A1") = a
Application.ScreenUpdating = True



End Sub
 
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
offset match Enyaw Excel Discussion (Misc queries) 1 February 17th 10 12:54 PM
match/Offset help jayklmno Excel Programming 0 November 4th 08 05:38 PM
IF, OFFSET,MATCH Please Help Xhawk57 Excel Discussion (Misc queries) 1 June 6th 08 08:58 PM
Using MAX with OFFSET and MATCH Joe Gieder Excel Worksheet Functions 3 October 12th 05 10:34 PM
Using Offset and Match Andrew Scurrah[_2_] Excel Programming 1 June 4th 04 12:01 AM


All times are GMT +1. The time now is 09:33 PM.

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"