LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default WorksheetFunction.Match Usage?

I am attempting to use the following code to:
loop through a range of cells and check each cell to see if its value exists in an array in a different sheet. The function tells how many matches were found.

Function ShiftTCC(Week As Range)

Set ProductRange = Sheets(Week.Value).Range("B1:B50")
Set ProductArray = Sheets("Classes").Range("A3:A15")

If Not ProductRange Is Nothing Then
For Each ProductCell In ProductRange
MsgBox ProductCell.Value
m = WorksheetFunction.Match(ProductCell.Value, ProductArray, 0)
if m 0 then
totalcount = totalcount + 1
end if
Next

ShiftTCC = totalcount

End If

End Function
 
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
worksheetfunction.match Li Jianyong[_2_] Excel Programming 11 March 10th 10 10:07 PM
Problems with WorksheetFunction.Index and WorksheetFunction.Match Luke Excel Programming 4 October 14th 09 12:57 AM
WorksheetFunction.Match John P[_2_] Excel Programming 5 July 10th 09 08:10 AM
worksheetfunction.match David Robinson[_3_] Excel Programming 4 November 15th 03 06:35 PM
Worksheetfunction MATCH Yves Janssens Excel Programming 2 October 6th 03 03:25 PM


All times are GMT +1. The time now is 06:09 AM.

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"