View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Shandy720[_9_] Shandy720[_9_] is offline
external usenet poster
 
Posts: 1
Default Match data in separate columns!


Hi thanks for your help Bob but i get the following message when i tr
to run your macro;
'Run time error 424
Object required',

and the follwong line of your code is highlighted
'If Not rng Is Nothing Then'


Bob Phillips Wrote:
For i = 1 to Cells(Rows.Count,"A").End(xlUp).Row
If Cells(I,"B").Value = Cells(i,"H").Value Then
If rng Is Nothing Then
set rng = Rows(i)
Else
Set rng = Union(rng,Rows(i))
End If
End iF
Next i

If Not rng Is Nothing Then
rng.copy Worksheets("Sheet2").Range("A1")
End If

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Shandy720"
wrote
in messag
...

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 a

only
interested in rows where the cells in two specific columns ar

equal.
Therefore I want a macro which will looks through the data and
highlights any rows which have the same value in columns 'B' an

'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


--
Shandy72
-----------------------------------------------------------------------
Shandy720's Profile: http://www.excelforum.com/member.php...fo&userid=2623
View this thread: http://www.excelforum.com/showthread.php?threadid=47906