LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default unmatched data string

Thanks so much, it worked perfectly.

"Rick Rothstein" wrote:

The following macro should do what you want AS LONG AS the cell entry for
any given row in one column is the same length as the corresponding cell
entry for that same row in the other column (which is what your sample data
showed); just change the Column1 and Column2 constants to the column letters
corresponding to your actual data and change the worksheet reference in the
With statement to the worksheet name where your data is located...

Sub HighlightDifferences()
Dim X As Long
Dim Z As Long
Dim LastRow As Long
Const Column1 As String = "A"
Const Column2 As String = "B"
With Worksheets("Sheet1")
LastRow = .Cells(.Rows.Count, Column1).End(xlUp).Row
For X = 1 To LastRow
.Cells(X, Column1).Characters.Font.ColorIndex = xlColorIndexAutomatic
.Cells(X, Column2).Characters.Font.ColorIndex = xlColorIndexAutomatic
For Z = 1 To Len(.Cells(X, Column1).Value)
If .Cells(X, Column1).Characters(Z, 1).Text < _
.Cells(X, Column2).Characters(Z, 1).Text Then
.Cells(X, Column1).Characters(Z, 1).Font.ColorIndex = 3
.Cells(X, Column2).Characters(Z, 1).Font.ColorIndex = 3
End If
Next
Next
End With
End Sub

--
Rick (MVP - Excel)


"aileen" wrote in message
...
I have two strings of data that I compare with a vlookup and then I kick
out
the data that doesn't match into two different columns. I am wondering if
it
is possible to have the strings of data highlight just the portion of the
string that doesn't match.
For example:
2008JXA800OCT0250 2008JXA800JAN0250

2008JXA850OCT0301 2008JXA850JAN0306

2009JXA900OCT07 2008JXA900JAN07
The 1st string would highlight the OCT and the 2nd string across from it
would highlight the JAN. While the next row the 1st string would
highlight
the 1 and the 2nd string across from it would highlight the 6 and in the
third row the 1st string would highlight the 9 (from the 2009) and the 2nd
string across from it would highlight the 8(from the 2008).

Any help is always appreciated. Thanks!



 
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
Finding Unmatched Records PA New Users to Excel 2 April 21st 10 03:47 PM
Unmatched Query vrk1 Excel Programming 3 March 20th 08 04:47 PM
To Find Unmatched data in a Column Himani Excel Discussion (Misc queries) 4 February 10th 07 05:30 PM
flagging unmatched items!!! via135 via OfficeKB.com Excel Worksheet Functions 6 July 11th 06 07:51 PM
finding unmatched data Chester1 Excel Worksheet Functions 3 February 10th 06 01:27 PM


All times are GMT +1. The time now is 09:31 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"