Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Compare 2 ranges

I'm attempting to look at every value in a discontinuguous range (defined
name of "billraterange") and see if it matches any of the values in another
range (defined name of "raterange"). If so, tell me the cell address in
"billraterange".

I'm open to other approaches beside the use of MATCH. Thanks for your help!
Jason

**************

Private Sub Worksheet_Deactivate()

Dim ValRng As Range
Dim Answer As Variant

Set RateRng = Sheets("Input").Range("raterange")

For Each ValRng In ThisWorkbook.Sheets("Input").Range("billraterange" )
Answer = Application.WorksheetFunction.Match(ValRng.Value, RateRang, 0)
If IsError(Answer) Then
MsgBox ValRng.Address
End If
Next

End Sub
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Compare 2 ranges

Dim ValRng As Range
Dim Answer As Variant

Set RateRng = Sheets("Input").Range("raterange")

For Each ValRng In Sheets("Input").Range("billraterange")
Set varFound = RateRng.Find(ValRng.Value)
If Not varFound Is Nothing Then
MsgBox varFound.Address
End If
Next

If this post helps click Yes
---------------
Jacob Skaria


"Jason Morin" wrote:

I'm attempting to look at every value in a discontinuguous range (defined
name of "billraterange") and see if it matches any of the values in another
range (defined name of "raterange"). If so, tell me the cell address in
"billraterange".

I'm open to other approaches beside the use of MATCH. Thanks for your help!
Jason

**************

Private Sub Worksheet_Deactivate()

Dim ValRng As Range
Dim Answer As Variant

Set RateRng = Sheets("Input").Range("raterange")

For Each ValRng In ThisWorkbook.Sheets("Input").Range("billraterange" )
Answer = Application.WorksheetFunction.Match(ValRng.Value, RateRang, 0)
If IsError(Answer) Then
MsgBox ValRng.Address
End If
Next

End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Compare 2 ranges

Jacob,

Your code got me going in the right direction. Thanks and thanks to Don, too.

Jason

"Jacob Skaria" wrote:

Dim ValRng As Range
Dim Answer As Variant

Set RateRng = Sheets("Input").Range("raterange")

For Each ValRng In Sheets("Input").Range("billraterange")
Set varFound = RateRng.Find(ValRng.Value)
If Not varFound Is Nothing Then
MsgBox varFound.Address
End If
Next

If this post helps click Yes
---------------
Jacob Skaria


"Jason Morin" wrote:

I'm attempting to look at every value in a discontinuguous range (defined
name of "billraterange") and see if it matches any of the values in another
range (defined name of "raterange"). If so, tell me the cell address in
"billraterange".

I'm open to other approaches beside the use of MATCH. Thanks for your help!
Jason

**************

Private Sub Worksheet_Deactivate()

Dim ValRng As Range
Dim Answer As Variant

Set RateRng = Sheets("Input").Range("raterange")

For Each ValRng In ThisWorkbook.Sheets("Input").Range("billraterange" )
Answer = Application.WorksheetFunction.Match(ValRng.Value, RateRang, 0)
If IsError(Answer) Then
MsgBox ValRng.Address
End If
Next

End Sub

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
compare two or more ranges tywlam Excel Worksheet Functions 3 April 23rd 09 10:18 AM
Compare ranges tywlam Excel Worksheet Functions 0 April 23rd 09 04:07 AM
Using IF to compare ranges [email protected] Excel Worksheet Functions 5 April 8th 09 06:47 PM
Compare Ranges ranswrt Excel Programming 2 September 10th 08 11:38 PM
Compare ranges Johnnyb Excel Programming 0 August 11th 04 02:30 PM


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