Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default 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
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
Countif worksheet function frustrations Santa-D Excel Worksheet Functions 8 October 30th 06 05:14 AM
CountIF() in Worksheet B while referencing cells in Worksheet A jfj3rd Excel Worksheet Functions 3 April 14th 06 11:24 PM
CountIF() in Worksheet B while referencing cells in Worksheet A jfj3rd Excel Worksheet Functions 3 April 14th 06 07:36 PM
How do I use a countif function according to two other countif fu. Kirsty Excel Worksheet Functions 2 February 20th 06 11:44 AM
Embed a countif function in subtotal function? Stuck at work Excel Worksheet Functions 1 February 14th 06 03:19 AM


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