#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default match

Hi,
I'm trying to test to see if a string exists in a range.
foundmatch = Application.WorksheetFunction.Match("wjv",
Range("staff").Value, 0)
works if range staff is a single column or row, if the range is a matrix it
returns 0
I tried useing
foundcount =
Application.WorksheetFunction.CountIf(Range("group _code").Value, "WVJ")
where group_code is more than a single row or column, it also returns 0.

Any ideas would be greatly appreciated.

peter
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default match

Try dropping the ".value" from your countif example.

--
Tim Williams
Palo Alto, CA


"peter" wrote in message ...
Hi,
I'm trying to test to see if a string exists in a range.
foundmatch = Application.WorksheetFunction.Match("wjv",
Range("staff").Value, 0)
works if range staff is a single column or row, if the range is a matrix it
returns 0
I tried useing
foundcount =
Application.WorksheetFunction.CountIf(Range("group _code").Value, "WVJ")
where group_code is more than a single row or column, it also returns 0.

Any ideas would be greatly appreciated.

peter



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default match

first, thanks for your help.
I took off the .value, then the range, then the quotes, nothing worked. Did
it work for you?

peter

"Tim Williams" wrote:

Try dropping the ".value" from your countif example.

--
Tim Williams
Palo Alto, CA


"peter" wrote in message ...
Hi,
I'm trying to test to see if a string exists in a range.
foundmatch = Application.WorksheetFunction.Match("wjv",
Range("staff").Value, 0)
works if range staff is a single column or row, if the range is a matrix it
returns 0
I tried useing
foundcount =
Application.WorksheetFunction.CountIf(Range("group _code").Value, "WVJ")
where group_code is more than a single row or column, it also returns 0.

Any ideas would be greatly appreciated.

peter




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default match

Countif only works on a range, not an array

foundcount = Application.CountIf(Range("group_code"), "WVJ")

should give you the correct count of cells that contain only the characters
WVJ in that order.

You are correct that match only works on a single column or single row.

--
Regards,
Tom Ogilvy


"peter" wrote:

first, thanks for your help.
I took off the .value, then the range, then the quotes, nothing worked. Did
it work for you?

peter

"Tim Williams" wrote:

Try dropping the ".value" from your countif example.

--
Tim Williams
Palo Alto, CA


"peter" wrote in message ...
Hi,
I'm trying to test to see if a string exists in a range.
foundmatch = Application.WorksheetFunction.Match("wjv",
Range("staff").Value, 0)
works if range staff is a single column or row, if the range is a matrix it
returns 0
I tried useing
foundcount =
Application.WorksheetFunction.CountIf(Range("group _code").Value, "WVJ")
where group_code is more than a single row or column, it also returns 0.

Any ideas would be greatly appreciated.

peter




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
Match formula to match values in multiple columns K[_2_] Excel Discussion (Misc queries) 2 April 22nd 10 10:22 AM
Lookup Formula: Return 1st match, then 2nd match, then 3rd match Scott Excel Discussion (Misc queries) 4 December 11th 09 05:50 AM
index(match) Wind Uplift Calculations (match four conditions) JMeier Excel Worksheet Functions 8 August 1st 08 01:45 AM
MATCH Multiple Criteria & Return Previous / Penultimate Match Sam via OfficeKB.com Excel Worksheet Functions 27 October 6th 07 01:39 AM
Lookup? Match? pulling rows from one spreadsheet to match a text f cjax Excel Worksheet Functions 3 July 21st 06 02:51 PM


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