LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default A Function to Compare Values


Try somethink like the following (sustituting) the names of your ranges.
List1 contains all items. List2 in the "Out of stocK" list.


Sub CheckStock()
Dim oCell As Range
For Each oCell In Range("List1")
If IsError(Application.Match(oCell, Range("List2"), 0)) Then

oCell.Offset(0, 1) = "OK"
Else
oCell.Offset(0, 1) = "Out of stock"
End If
Next
End Sub


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

 
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 values on sheet 1 to values on sheet2 Colin Excel Worksheet Functions 2 August 2nd 06 07:19 PM
Excel Compare values in columns & display missing values in a new cpetta Excel Discussion (Misc queries) 1 April 2nd 05 05:51 AM
Compare Listbox values with Collection values Stuart[_5_] Excel Programming 2 September 20th 03 01:58 PM
compare values between workbooks and copy values bgardiner Excel Programming 0 September 9th 03 03:54 PM


All times are GMT +1. The time now is 05:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"