Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem with code. (Compare all cells)


I have the following code to arrange and merge a couple of sheets for
me. The problem that I have is with this piticular code my only
compares across rows. I need it to check all rows. For example compare
row 1 of OOR1 to row 2,3,4,5... of OOR2. Any ideas?


Thanks,

Met




Code:
--------------------

Sub Arrange()
For a = 1 To 1000
If Sheets("OOR1").Cells(a, "a") = Sheets("OOR2").Cells(a, "a") Then Sheets("OOR1").Cells(a, "H") = Sheets("OOR2").Cells(a, "b")
Next a
Worksheets("OOR1").Select
Dim RngToCopy As Range
Dim DestCell As Range
Set RngToCopy = Worksheets("OOR1").Range("a2:m10000")
Set DestCell = Worksheets("Master").Range("a7")
With RngToCopy
DestCell.Resize(.Rows.Count, .Columns.Count).Value _
= .Value
End With
Worksheets("Master").Select
Columns("A").SpecialCells(xlCellTypeBlanks).Entire Row.Delete
End Sub

--------------------


--
Metrazal
------------------------------------------------------------------------
Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648
View this thread: http://www.excelforum.com/showthread...hreadid=521038

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem with code. (Compare all cells)


Code:
--------------------


Sub Arrange()
For a = 1 To 1000
x = Application.Match(Sheets("OOR1").Cells(a, "a"), Sheets("OOR2").Columns("a"), 0)
If IsNumeric(x) Then Sheets("OOR1").Cells(a, "H") = Sheets("OOR2").Cells(x, "b")
Next a
Worksheets("OOR1").Select
Dim RngToCopy As Range
Dim DestCell As Range
Set RngToCopy = Worksheets("OOR1").Range("a2:m10000")
Set DestCell = Worksheets("Master").Range("a7")
With RngToCopy
DestCell.Resize(.Rows.Count, .Columns.Count).Value _
= .Value
End With
Worksheets("Master").Select
Columns("A").SpecialCells(xlCellTypeBlanks).Entire Row.Delete
End Sub


--------------------


--
Metrazal
------------------------------------------------------------------------
Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648
View this thread: http://www.excelforum.com/showthread...hreadid=521038

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
How do I compare cells and if FALSE compare to next cell in EXCEL Cindie Excel Worksheet Functions 0 March 24th 06 05:29 PM
Help with VB code to compare two columns Farooq Sheri Excel Programming 3 January 23rd 06 11:10 AM
Error Code when compare cells in excel macro todd Excel Programming 4 October 5th 05 08:35 PM
Compare tabs using Double Lookup, in VB code Ricky Pang Excel Programming 4 October 29th 03 06:50 PM
Compare tabs using Double Lookup, in VB code Ricky Pang Excel Programming 1 October 7th 03 12:06 PM


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