Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JBW JBW is offline
external usenet poster
 
Posts: 42
Default VB count word occurence in variable size sheet

Me again folks, sorry.

System report will be variable number of rows deep, I have macro that's
running sweetly but counter in VB is set to big number to make sure all lines
calculated. I need to be able to count he occurences of "NPQ" in the sheet,
this will give me correct counter number for vb.

How do I do count?
How do I refernce answer in the macro?

cheers in advance for all your wonderful help
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default VB count word occurence in variable size sheet

myVal = application.countif(activesheet.cells,"NPQ")

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"JBW" wrote in message
...
Me again folks, sorry.

System report will be variable number of rows deep, I have macro that's
running sweetly but counter in VB is set to big number to make sure all
lines
calculated. I need to be able to count he occurences of "NPQ" in the
sheet,
this will give me correct counter number for vb.

How do I do count?
How do I refernce answer in the macro?

cheers in advance for all your wonderful help



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default VB count word occurence in variable size sheet

If you are trying to use this count value as the terminating value in a loop
then try:-

Sub stance()
For x = 1 To Application.CountIf(ActiveSheet.Cells, "NPQ")

'Your macro

Next

End Sub

Mike

"JBW" wrote:

Bob,

If I use that in my macro it'll count the NPQ for me, but how do I use the
naswer in my for Counter = 1 to 100 line?



"Bob Phillips" wrote:

myVal = application.countif(activesheet.cells,"NPQ")

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"JBW" wrote in message
...
Me again folks, sorry.

System report will be variable number of rows deep, I have macro that's
running sweetly but counter in VB is set to big number to make sure all
lines
calculated. I need to be able to count he occurences of "NPQ" in the
sheet,
this will give me correct counter number for vb.

How do I do count?
How do I refernce answer in the macro?

cheers in advance for all your wonderful help




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JBW JBW is offline
external usenet poster
 
Posts: 42
Default VB count word occurence in variable size sheet

Bob,

If I use that in my macro it'll count the NPQ for me, but how do I use the
naswer in my for Counter = 1 to 100 line?



"Bob Phillips" wrote:

myVal = application.countif(activesheet.cells,"NPQ")

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"JBW" wrote in message
...
Me again folks, sorry.

System report will be variable number of rows deep, I have macro that's
running sweetly but counter in VB is set to big number to make sure all
lines
calculated. I need to be able to count he occurences of "NPQ" in the
sheet,
this will give me correct counter number for vb.

How do I do count?
How do I refernce answer in the macro?

cheers in advance for all your wonderful help




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default VB count word occurence in variable size sheet

For cntr = 1 To myVal

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"JBW" wrote in message
...
Bob,

If I use that in my macro it'll count the NPQ for me, but how do I use the
naswer in my for Counter = 1 to 100 line?



"Bob Phillips" wrote:

myVal = application.countif(activesheet.cells,"NPQ")

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"JBW" wrote in message
...
Me again folks, sorry.

System report will be variable number of rows deep, I have macro that's
running sweetly but counter in VB is set to big number to make sure all
lines
calculated. I need to be able to count he occurences of "NPQ" in the
sheet,
this will give me correct counter number for vb.

How do I do count?
How do I refernce answer in the macro?

cheers in advance for all your wonderful help








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JBW JBW is offline
external usenet poster
 
Posts: 42
Default VB count word occurence in variable size sheet

Thanks worked a treat



"Bob Phillips" wrote:

For cntr = 1 To myVal

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"JBW" wrote in message
...
Bob,

If I use that in my macro it'll count the NPQ for me, but how do I use the
naswer in my for Counter = 1 to 100 line?



"Bob Phillips" wrote:

myVal = application.countif(activesheet.cells,"NPQ")

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"JBW" wrote in message
...
Me again folks, sorry.

System report will be variable number of rows deep, I have macro that's
running sweetly but counter in VB is set to big number to make sure all
lines
calculated. I need to be able to count he occurences of "NPQ" in the
sheet,
this will give me correct counter number for vb.

How do I do count?
How do I refernce answer in the macro?

cheers in advance for all your wonderful help






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
How to count occurence of multiple characters in a cell MLK Excel Worksheet Functions 4 March 9th 07 12:51 AM
count occurence and present results Hobbes2006 Excel Worksheet Functions 2 August 7th 06 09:42 PM
Using Sumproduct to count text occurence Dave Excel Worksheet Functions 1 July 25th 06 06:15 PM
Count the occurence of more than one condition wutang1105 Excel Worksheet Functions 1 August 26th 05 07:21 PM
I need to count the occurence of text in a range of cells (which . Brenda Excel Worksheet Functions 1 December 12th 04 09:00 PM


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