+ Reply to Thread
Results 1 to 3 of 3

using Countif Function: Column number stored in a variable

  1. #1
    Forum Contributor
    Join Date
    02-22-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    102

    using Countif Function: Column number stored in a variable

    Hello,

    Would require vba code for the given example please..

    need to count number of "Pass" for a particular column and the column number is stored in a variable ( say Variable Resultval= 3, countif should calculate number of "Pass" in column C )

    tried following code but could not get expected result
    Please Login or Register  to view this content.
    Thanks.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,372

    Re: using Countif Function: Column number stored in a variable

    Hi,

    Look at using a WorksheetFunction in your VBA code.
    See:

    http://msdn.microsoft.com/en-us/libr...ffice.11).aspx
    Countif is a valid WorksheetFunction.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor
    Join Date
    02-22-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    102

    Re: using Countif Function: Column number stored in a variable

    Thanks Marvin... it is resolved ( but still curious to understand what is wrong with the 'Evaluate' i have used...will try and figure out later....thanks for your quick help)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA column name stored in variable excel
    By gaviriache in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-22-2013, 09:46 PM
  2. [SOLVED] Vba countif with criteria being a variable row number
    By Estrella Linda in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-11-2012, 02:32 PM
  3. [SOLVED] HOW TO FIND THE COLUMN OR ROW NUMBER of a address stored in a cell
    By chrismonica in forum Excel General
    Replies: 3
    Last Post: 07-07-2012, 10:43 AM
  4. Replies: 0
    Last Post: 07-05-2012, 10:30 PM
  5. "Countif" function stored as variable in Macro?
    By rziegler in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-02-2009, 04:00 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1