Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet Function COUNTIF
In my code, I'm trying to return a count of instances (intJobCount) a value exists in worksheet column D. This value being set as variable strJobNumb. The following code is preventing my code from even starting. The variable strJobNumb will always be an alphameric beginning with a letter.
This line of code will stop me from running with a < Compile error: Expected list separator or ) intJobCount = Application.WorksheetFunction.CountIf(D:D, strJobNumb) If I add quotes to the columns such as below, it will not run, and I will get a < Compile error: Type mismatch intJobCount = Application.WorksheetFunction.CountIf("D:D", strJobNumb) Any Ideas? D.S. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet Function COUNTIF
Hi D.S,
Try this ....... intJobCount = Application.WorksheetFunction.CountIf(Range("D:D") , strJobNumb) Cheers Nigel "D.S." wrote in message ... In my code, I'm trying to return a count of instances (intJobCount) a value exists in worksheet column D. This value being set as variable strJobNumb. The following code is preventing my code from even starting. The variable strJobNumb will always be an alphameric beginning with a letter. This line of code will stop me from running with a < Compile error: Expected list separator or ) intJobCount = Application.WorksheetFunction.CountIf(D:D, strJobNumb) If I add quotes to the columns such as below, it will not run, and I will get a < Compile error: Type mismatch intJobCount = Application.WorksheetFunction.CountIf("D:D", strJobNumb) Any Ideas? D.S. ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =--- |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet Function COUNTIF
"D.S." wrote...
.... This line of code will stop me from running with a < Compile error: Expected list separator or ) intJobCount = Application.WorksheetFunction.CountIf(D:D, strJobNumb) If I add quotes to the columns such as below, it will not run, and I will get a < Compile error: Type mismatch intJobCount = Application.WorksheetFunction.CountIf("D:D", strJobNumb) Any Ideas? Neither D:D plain nor "D:D" would be recognizable as tokens resolving to range references. Try something like intJobCount = Application.WorksheetFunction.CountIf(Range("D:D") , strJobNumb) or variations qualifying Range("D:D"), such as Activesheet.Range("D:D"). |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet Function COUNTIF
Thank you Nigel, that's what I needed it. Works great.
D.S. "Anonymous" <Nobody wrote in message ... Hi D.S, Try this ....... intJobCount = Application.WorksheetFunction.CountIf(Range("D:D") , strJobNumb) Cheers Nigel "D.S." wrote in message ... In my code, I'm trying to return a count of instances (intJobCount) a value exists in worksheet column D. This value being set as variable strJobNumb. The following code is preventing my code from even starting. The variable strJobNumb will always be an alphameric beginning with a letter. This line of code will stop me from running with a < Compile error: Expected list separator or ) intJobCount = Application.WorksheetFunction.CountIf(D:D, strJobNumb) If I add quotes to the columns such as below, it will not run, and I will get a < Compile error: Type mismatch intJobCount = Application.WorksheetFunction.CountIf("D:D", strJobNumb) Any Ideas? D.S. ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =--- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Countif worksheet function frustrations | Excel Worksheet Functions | |||
CountIF() in Worksheet B while referencing cells in Worksheet A | Excel Worksheet Functions | |||
CountIF() in Worksheet B while referencing cells in Worksheet A | Excel Worksheet Functions | |||
How do I use a countif function according to two other countif fu. | Excel Worksheet Functions | |||
Embed a countif function in subtotal function? | Excel Worksheet Functions |