Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default count cells that don't contain a formula

I'm trying to use something like CountA, or CountIf, or even Countifs but I
can't figure out what criteria I should use.

I just want to count the cells in a range that don't contain a formula. I'm
sure this is an easy one. It's gotta be.

Thanks to anyone who can help me figure this out.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default count cells that don't contain a formula

Hi,

A UDF maybe. Alt+F11 to open VB editor. Right click 'This Workbook' and
insert module and paste the code below in

Call with

=noformula(a1:a10)

Function noformula(rng As Range) As Long
For Each c In rng
If Not c.HasFormula Then
noformula = noformula + 1
End If
Next
End Function

Mike

"Jonathan Brown" wrote:

I'm trying to use something like CountA, or CountIf, or even Countifs but I
can't figure out what criteria I should use.

I just want to count the cells in a range that don't contain a formula. I'm
sure this is an easy one. It's gotta be.

Thanks to anyone who can help me figure this out.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default count cells that don't contain a formula

You will need to used VBA. Here is a simple User Defined Function that does
what you want

Function noform(myrange)
For Each mycell In myrange
If mycell.HasFormula = False Then
noform = noform + 1
End If
Next mycell
End Function

You may wish to visit David McRitchie's site on "getting started" with VBA

http://www.mvps.org/dmcritchie/excel/getstarted.htm

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Jonathan Brown" wrote in message
...
I'm trying to use something like CountA, or CountIf, or even Countifs but
I
can't figure out what criteria I should use.

I just want to count the cells in a range that don't contain a formula.
I'm
sure this is an easy one. It's gotta be.

Thanks to anyone who can help me figure this out.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default count cells that don't contain a formula

This is great, I've created my own UDF named =Jonathan() (pretty original
eh?) However, I'm running into a problem. What I'm doing with my macro is
finding the needed range and then placing the formula =Jonathan(myrange) into
the activecell. And then I'm using the autofill method (using xlDefault
autofill type) to copy the formula across about 51 columns. When I use the
autofill method, all the cells except the activecell return #Value.

If I do the autofill manually with my mouse then the formulas work. Is the
fact that I'm using the autofill method with a UDF messing it up? Is there
something else I need to include in the UDF to specify how to use the
autofill method?

"Bernard Liengme" wrote:

You will need to used VBA. Here is a simple User Defined Function that does
what you want

Function noform(myrange)
For Each mycell In myrange
If mycell.HasFormula = False Then
noform = noform + 1
End If
Next mycell
End Function

You may wish to visit David McRitchie's site on "getting started" with VBA

http://www.mvps.org/dmcritchie/excel/getstarted.htm

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Jonathan Brown" wrote in message
...
I'm trying to use something like CountA, or CountIf, or even Countifs but
I
can't figure out what criteria I should use.

I just want to count the cells in a range that don't contain a formula.
I'm
sure this is an easy one. It's gotta be.

Thanks to anyone who can help me figure this out.




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default count cells that don't contain a formula

Isn't there like a recalculate method to force the cells to refresh, or
something?

"Jonathan Brown" wrote:

This is great, I've created my own UDF named =Jonathan() (pretty original
eh?) However, I'm running into a problem. What I'm doing with my macro is
finding the needed range and then placing the formula =Jonathan(myrange) into
the activecell. And then I'm using the autofill method (using xlDefault
autofill type) to copy the formula across about 51 columns. When I use the
autofill method, all the cells except the activecell return #Value.

If I do the autofill manually with my mouse then the formulas work. Is the
fact that I'm using the autofill method with a UDF messing it up? Is there
something else I need to include in the UDF to specify how to use the
autofill method?

"Bernard Liengme" wrote:

You will need to used VBA. Here is a simple User Defined Function that does
what you want

Function noform(myrange)
For Each mycell In myrange
If mycell.HasFormula = False Then
noform = noform + 1
End If
Next mycell
End Function

You may wish to visit David McRitchie's site on "getting started" with VBA

http://www.mvps.org/dmcritchie/excel/getstarted.htm

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Jonathan Brown" wrote in message
...
I'm trying to use something like CountA, or CountIf, or even Countifs but
I
can't figure out what criteria I should use.

I just want to count the cells in a range that don't contain a formula.
I'm
sure this is an easy one. It's gotta be.

Thanks to anyone who can help me figure this out.






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default count cells that don't contain a formula

This is the absolute last thing I gotta get working and then my job is done.
I'm desperate.

"Jonathan Brown" wrote:

Isn't there like a recalculate method to force the cells to refresh, or
something?

"Jonathan Brown" wrote:

This is great, I've created my own UDF named =Jonathan() (pretty original
eh?) However, I'm running into a problem. What I'm doing with my macro is
finding the needed range and then placing the formula =Jonathan(myrange) into
the activecell. And then I'm using the autofill method (using xlDefault
autofill type) to copy the formula across about 51 columns. When I use the
autofill method, all the cells except the activecell return #Value.

If I do the autofill manually with my mouse then the formulas work. Is the
fact that I'm using the autofill method with a UDF messing it up? Is there
something else I need to include in the UDF to specify how to use the
autofill method?

"Bernard Liengme" wrote:

You will need to used VBA. Here is a simple User Defined Function that does
what you want

Function noform(myrange)
For Each mycell In myrange
If mycell.HasFormula = False Then
noform = noform + 1
End If
Next mycell
End Function

You may wish to visit David McRitchie's site on "getting started" with VBA

http://www.mvps.org/dmcritchie/excel/getstarted.htm

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Jonathan Brown" wrote in message
...
I'm trying to use something like CountA, or CountIf, or even Countifs but
I
can't figure out what criteria I should use.

I just want to count the cells in a range that don't contain a formula.
I'm
sure this is an easy one. It's gotta be.

Thanks to anyone who can help me figure this out.



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default count cells that don't contain a formula

Send me your file (take TRUENORTH out of my address)
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Jonathan Brown" wrote in message
...
This is the absolute last thing I gotta get working and then my job is
done.
I'm desperate.

"Jonathan Brown" wrote:

Isn't there like a recalculate method to force the cells to refresh, or
something?

"Jonathan Brown" wrote:

This is great, I've created my own UDF named =Jonathan() (pretty
original
eh?) However, I'm running into a problem. What I'm doing with my
macro is
finding the needed range and then placing the formula
=Jonathan(myrange) into
the activecell. And then I'm using the autofill method (using
xlDefault
autofill type) to copy the formula across about 51 columns. When I use
the
autofill method, all the cells except the activecell return #Value.

If I do the autofill manually with my mouse then the formulas work. Is
the
fact that I'm using the autofill method with a UDF messing it up? Is
there
something else I need to include in the UDF to specify how to use the
autofill method?

"Bernard Liengme" wrote:

You will need to used VBA. Here is a simple User Defined Function
that does
what you want

Function noform(myrange)
For Each mycell In myrange
If mycell.HasFormula = False Then
noform = noform + 1
End If
Next mycell
End Function

You may wish to visit David McRitchie's site on "getting started"
with VBA

http://www.mvps.org/dmcritchie/excel/getstarted.htm

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Jonathan Brown" wrote in
message
...
I'm trying to use something like CountA, or CountIf, or even
Countifs but
I
can't figure out what criteria I should use.

I just want to count the cells in a range that don't contain a
formula.
I'm
sure this is an easy one. It's gotta be.

Thanks to anyone who can help me figure this out.





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
Formula to count Highlited Cells. Jman Excel Discussion (Misc queries) 3 September 27th 08 01:45 AM
Formula to count cells between dates. Vegs Excel Worksheet Functions 4 June 12th 06 06:56 PM
how can I count blank cells as a zero, when using formula please?? Ted Excel Worksheet Functions 5 November 22nd 05 06:14 PM
formula to count cells not blanK pmarques Excel Worksheet Functions 4 August 3rd 05 01:44 PM
need formula to count cells below Bill_S Excel Discussion (Misc queries) 3 January 20th 05 10:41 PM


All times are GMT +1. The time now is 11:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"