Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default help needed with Countif....

I'm trying to use the following function in VBA:

=COUNTIF(B2:B2005,B14)

Where B2 will never change, B2005 is determined by the following code:

Application.WorksheetFunction.CountA(Worksheets("w orking
data").Range("A1:A65536"))

and B14 is the column B and the current row of a table.

I have tried :

iteration = Application.WorksheetFunction.CountIf(Worksheets(" working
data").Range("A1:K" & rcount + 1), "B" & rowx)

where rowx is predefined as 2, and incremented by 1 each time a go through
the loop....but al I get back on this is a big - fat - zero.

What am I doing wrong ?

Thanks !
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default help needed with Countif....

maybe...

with worksheets("working data")
iteration = Application.CountIf(.Range("A1:K" & rcount + 1), _
.range("B" & rowx))
end with




Eric @ BP-EVV wrote:

I'm trying to use the following function in VBA:

=COUNTIF(B2:B2005,B14)

Where B2 will never change, B2005 is determined by the following code:

Application.WorksheetFunction.CountA(Worksheets("w orking
data").Range("A1:A65536"))

and B14 is the column B and the current row of a table.

I have tried :

iteration = Application.WorksheetFunction.CountIf(Worksheets(" working
data").Range("A1:K" & rcount + 1), "B" & rowx)

where rowx is predefined as 2, and incremented by 1 each time a go through
the loop....but al I get back on this is a big - fat - zero.

What am I doing wrong ?

Thanks !


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default help needed with Countif....

Thanks for the suggestion Dave - I wish I had better results...I got "Object
doesn't support this property or method" as an error.

Anyone else have other ideas ?

Thanks !


"Dave Peterson" wrote:

maybe...

with worksheets("working data")
iteration = Application.CountIf(.Range("A1:K" & rcount + 1), _
.range("B" & rowx))
end with




Eric @ BP-EVV wrote:

I'm trying to use the following function in VBA:

=COUNTIF(B2:B2005,B14)

Where B2 will never change, B2005 is determined by the following code:

Application.WorksheetFunction.CountA(Worksheets("w orking
data").Range("A1:A65536"))

and B14 is the column B and the current row of a table.

I have tried :

iteration = Application.WorksheetFunction.CountIf(Worksheets(" working
data").Range("A1:K" & rcount + 1), "B" & rowx)

where rowx is predefined as 2, and incremented by 1 each time a go through
the loop....but al I get back on this is a big - fat - zero.

What am I doing wrong ?

Thanks !


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default help needed with Countif....

I'd guess that there was something wrong with rcount or rowx.

But that's a guess. I didn't see how you set those variables to anything.

Eric @ BP-EVV wrote:

Thanks for the suggestion Dave - I wish I had better results...I got "Object
doesn't support this property or method" as an error.

Anyone else have other ideas ?

Thanks !

"Dave Peterson" wrote:

maybe...

with worksheets("working data")
iteration = Application.CountIf(.Range("A1:K" & rcount + 1), _
.range("B" & rowx))
end with




Eric @ BP-EVV wrote:

I'm trying to use the following function in VBA:

=COUNTIF(B2:B2005,B14)

Where B2 will never change, B2005 is determined by the following code:

Application.WorksheetFunction.CountA(Worksheets("w orking
data").Range("A1:A65536"))

and B14 is the column B and the current row of a table.

I have tried :

iteration = Application.WorksheetFunction.CountIf(Worksheets(" working
data").Range("A1:K" & rcount + 1), "B" & rowx)

where rowx is predefined as 2, and incremented by 1 each time a go through
the loop....but al I get back on this is a big - fat - zero.

What am I doing wrong ?

Thanks !


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default help needed with Countif....

I solved it - here's how the code looks now (tested and works):

iteration = Application.WorksheetFunction.CountIf(Worksheets(" working
data").Range("B1:B" & rcount), Worksheets("working data").Range("B" & rowx))

I'm glad I worked this on out, the bruise on my forehead from hitting the
wall too many times was getting rather large !

"Dave Peterson" wrote:

I'd guess that there was something wrong with rcount or rowx.

But that's a guess. I didn't see how you set those variables to anything.

Eric @ BP-EVV wrote:

Thanks for the suggestion Dave - I wish I had better results...I got "Object
doesn't support this property or method" as an error.

Anyone else have other ideas ?

Thanks !

"Dave Peterson" wrote:

maybe...

with worksheets("working data")
iteration = Application.CountIf(.Range("A1:K" & rcount + 1), _
.range("B" & rowx))
end with




Eric @ BP-EVV wrote:

I'm trying to use the following function in VBA:

=COUNTIF(B2:B2005,B14)

Where B2 will never change, B2005 is determined by the following code:

Application.WorksheetFunction.CountA(Worksheets("w orking
data").Range("A1:A65536"))

and B14 is the column B and the current row of a table.

I have tried :

iteration = Application.WorksheetFunction.CountIf(Worksheets(" working
data").Range("A1:K" & rcount + 1), "B" & rowx)

where rowx is predefined as 2, and incremented by 1 each time a go through
the loop....but al I get back on this is a big - fat - zero.

What am I doing wrong ?

Thanks !

--

Dave Peterson


--

Dave Peterson

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 help needed Jessica Krall Excel Worksheet Functions 6 May 11th 10 06:47 PM
Help needed on possible countif.. GD Excel Discussion (Misc queries) 3 April 6th 09 12:59 PM
countif formula needed dmdodds Excel Discussion (Misc queries) 3 October 10th 07 07:54 AM
CountIf Function Help Needed Mark Excel Worksheet Functions 4 January 30th 06 03:37 AM
Countif help needed tamato43 Excel Discussion (Misc queries) 2 March 19th 05 11:56 PM


All times are GMT +1. The time now is 03:27 AM.

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"