Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default application.worksheetfunction. <function (syntax)

Dear all,

What would be the correct syntaxis if wanted to use the outcome of the
worksheetfunction countif in a range that goes from b2 to b2000 on a sheet
named "X" and the outcome should contain the number of cells that contain
the value 212.

I think it would look a little like this

MyValue = Application.WorksheetFunction.CountIf( range , "*212*" ).

Simply recording a macro that places the countif-function directly into a
cell with all arguments required for my goal does not work.

Thanks for your help

Peter


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default application.worksheetfunction. <function (syntax)

Peter,

Try something like

MyValue = Application.WorksheetFunction.CountIf( _
Worksheets("X").Range("B2:B2000"),"*212*")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com





"Peter" wrote in message
...
Dear all,

What would be the correct syntaxis if wanted to use the outcome

of the
worksheetfunction countif in a range that goes from b2 to b2000

on a sheet
named "X" and the outcome should contain the number of cells

that contain
the value 212.

I think it would look a little like this

MyValue = Application.WorksheetFunction.CountIf( range ,

"*212*" ).

Simply recording a macro that places the countif-function

directly into a
cell with all arguments required for my goal does not work.

Thanks for your help

Peter




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default application.worksheetfunction. <function (syntax)

Thanks for the tip, Chip. Unfortunately I get the error Expected: Expression
when I try this.

Peter


"Chip Pearson" schreef in bericht
...
Peter,

Try something like

MyValue = Application.WorksheetFunction.CountIf( _
Worksheets("X").Range("B2:B2000"),"*212*")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com





"Peter" wrote in message
...
Dear all,

What would be the correct syntaxis if wanted to use the outcome

of the
worksheetfunction countif in a range that goes from b2 to b2000

on a sheet
named "X" and the outcome should contain the number of cells

that contain
the value 212.

I think it would look a little like this

MyValue = Application.WorksheetFunction.CountIf( range ,

"*212*" ).

Simply recording a macro that places the countif-function

directly into a
cell with all arguments required for my goal does not work.

Thanks for your help

Peter






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default application.worksheetfunction. <function (syntax)

I'm a liar, I just applied it the wrong way. How can an answer from Chip
Pearson possibly not work ?

Sorry


"Peter" schreef in bericht
...
Thanks for the tip, Chip. Unfortunately I get the error Expected:

Expression
when I try this.

Peter


"Chip Pearson" schreef in bericht
...
Peter,

Try something like

MyValue = Application.WorksheetFunction.CountIf( _
Worksheets("X").Range("B2:B2000"),"*212*")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com





"Peter" wrote in message
...
Dear all,

What would be the correct syntaxis if wanted to use the outcome

of the
worksheetfunction countif in a range that goes from b2 to b2000

on a sheet
named "X" and the outcome should contain the number of cells

that contain
the value 212.

I think it would look a little like this

MyValue = Application.WorksheetFunction.CountIf( range ,

"*212*" ).

Simply recording a macro that places the countif-function

directly into a
cell with all arguments required for my goal does not work.

Thanks for your help

Peter








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
Need help with Application.WorksheetFunction Ayo Excel Discussion (Misc queries) 4 May 14th 08 11:13 PM
Application.WorksheetFunction.Index syntax LJones[_2_] Excel Programming 3 August 4th 04 12:13 PM
Syntax for WorksheetFunction Match Hardy[_3_] Excel Programming 1 June 4th 04 11:33 AM
Syntax for WorksheetFunction Mike Fogleman Excel Programming 3 March 1st 04 09:13 PM
Using Application.WorksheetFunction.Ln(...) in VBA doco Excel Programming 4 August 25th 03 01:08 PM


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