Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default Match Values and Highlite row

Hi all, I have list of 6 digit numbers in Column A of Sheet2 like see
below

A …….col
665544
564788
658977
457896
335566
789456
etc……..

I want macro which should match Sheet1 Range("B2:B100") values in
Sheet2 Column A values (as shown above) and if value match then do
nothing but the value which don’t match then macro should higlight
that value cell row in Sheet1 from row B to F. Please can any friend
can help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Match Values and Highlite row

Public Sub Hilite()
Dim LastRow As Long
Dim i As Long

With Worksheets("Sheet1")

LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
For i = 1 To LastRow

If IsError(Application.Match(.Cells(i, "B").Value,
Worksheets("Sheet2").Columns(1),0) Then

.Cells(i, "B").Resize(,5).Interior.Colorindex = 38
End If
Next i
End Sub

--
__________________________________
HTH

Bob

"K" wrote in message
...
Hi all, I have list of 6 digit numbers in Column A of Sheet2 like see
below

A …….col
665544
564788
658977
457896
335566
789456
etc……..

I want macro which should match Sheet1 Range("B2:B100") values in
Sheet2 Column A values (as shown above) and if value match then do
nothing but the value which don’t match then macro should higlight
that value cell row in Sheet1 from row B to F. Please can any friend
can help


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default Match Values and Highlite row

On May 13, 12:59*pm, "Bob Phillips" wrote:
Public Sub Hilite()
Dim LastRow As Long
Dim i As Long

* * With Worksheets("Sheet1")

* * * * LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
* * * * For i = 1 To LastRow

* * * * * * If IsError(Application.Match(.Cells(i, "B").Value,
Worksheets("Sheet2").Columns(1),0) Then

* * * * * * * * .Cells(i, "B").Resize(,5).Interior.Colorindex = 38
* * * * * * End If
* * * * Next i
End Sub

--
__________________________________
HTH

Bob

"K" wrote in message

...
Hi all, I have list of 6 digit numbers in Column A of Sheet2 like see
below

*A …….col
665544
564788
658977
457896
335566
789456
etc……..

I want macro which should match Sheet1 Range("B2:B100") values in
Sheet2 Column A values (as shown above) and if value match then do
nothing but the value which don’t match then macro should higlight
that value cell row in Sheet1 from row B to F. Please can any friend
can help


Thanks Bob
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
Match formula to match values in multiple columns K[_2_] Excel Discussion (Misc queries) 2 April 22nd 10 10:22 AM
Match several values in €˜Summary Sheet to several values in €˜Mast ryguy7272 Excel Programming 4 December 8th 08 08:31 PM
how can we get unique values in match function for same match key. Xcel[_2_] Excel Worksheet Functions 11 December 7th 07 08:13 PM
Match Values in Rows with Partial Values in Columns ryguy7272 Excel Worksheet Functions 3 August 8th 07 05:14 PM
How do i compare values from two sheet and copy & paste if values match? rozb Excel Programming 0 March 5th 04 12:06 AM


All times are GMT +1. The time now is 03:31 PM.

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"