Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 345
Default Two Ranges, Spot Different Values

I have two ranges in the same sheet where I want to know
if a cell's value is different between the "original" and the copy.
The "in development" code below works but takes more than
a few seconds to run.

I'll be working thru ignoring some cells with formulas.
I will be able to get the row/col values for the two ranges
with their begining/ending row/col numbers.

I'm not yet familiar with 'specialcells' functions.

Can someone start me off with a more object oriented
approach to comparing values between two ranges having
exactly the same "shape" ?

Thanks. Neal Z

EndRow = 1847 'first range
OffSet = 1000 'copied range is 1000 rows below end of 1st range.
With Ws
For Row = 1 To EndRow '2847 1st row of copy
CheckRow = Row + EndRow + OffSet - 1
For Col = 5 To 100
'ignore cells with =row formulas as diff 'copy' row values do not
matter.
If InStr(.Cells(Row, Col).Formula, "=ROW") < 1 Then

If .Cells(Row, Col).Value < .Cells(CheckRow, Col).Value Then
TextA = .Cells(Row, Col).Value & " at row/col " _
& Row & "/" & Col & vbCr & .Cells(CheckRow, Col).Value _
& " at row " & CheckRow
Debug.Print TextA
Exit Sub
End If

End If
Next Col
Next Row
End With

--
Neal Z
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
Hosur an IT hot spot? [email protected] Excel Worksheet Functions 0 October 17th 07 03:47 PM
Two Ranges, Spot Different Values Neal Zimm Excel Programming 1 January 31st 07 11:45 PM
SPOT THE MISTAKE!.... WhytheQ Excel Programming 8 September 13th 06 01:11 PM
X marks the spot Optitron[_11_] Excel Programming 2 September 20th 05 06:38 PM
I want a name in one spot and it's code in another TwoWheelDemon Excel Discussion (Misc queries) 1 March 17th 05 04:31 PM


All times are GMT +1. The time now is 10:08 AM.

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"