Private Sub CommandButton1_Click()
Dim j As Integer, row As Integer
row = 1
For j = 1 To 15
If Cells(j, 2).Formula = Cells(j, 8).Formula Then
Cells(j, 2).Interior.Color = vbCyan
Cells(j, 8).Interior.Color = vbCyan
Worksheets("Sheet2").Cells(row, 1) = Cells(j, 1).Formula
' repeat this for all required columns
row = row + 1
End If
Next j
End Sub
Hope this helps.
Regards
Ken
"Shandy720" wrote:
Hi can someone please give me a little advice on the following,
hopefully if is a simple problem. I have a range of data but am only
interested in rows where the cells in two specific columns are equal.
Therefore I want a macro which will looks through the data and
highlights any rows which have the same value in columns 'B' and 'H',
then copies and pastes this data in another worksheet.
Any help would be very much appreciated,
Thanks kindly,
Andrew
--
Shandy720
------------------------------------------------------------------------
Shandy720's Profile: http://www.excelforum.com/member.php...o&userid=26230
View this thread: http://www.excelforum.com/showthread...hreadid=479065