+ Reply to Thread
Results 1 to 3 of 3

Macro for countif with dynamic range { R [i] C [j] : R[i] C [j+10] }

  1. #1
    Registered User
    Join Date
    10-13-2016
    Location
    India
    MS-Off Ver
    MS 2013
    Posts
    3

    Macro for countif with dynamic range { R [i] C [j] : R[i] C [j+10] }

    Dear Team,

    Need to write a macro to count (countif) a particular variable in a row. The Range is dynamic { R [i] C [j] : R[i] C [j+10] }
    The result should be stored into a variable. Please provide with a sample code for the same

    In the below example, Range("B2:L2") should be replaced with R [i] C [j] : R[i] C [j+10] to make it dynamic
    X = Application.WorksheetFunction.CountIf(Sheets("Data").Range("B2:L2"), "Open")

    Regards,
    Lijo

  2. #2
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: Macro for countif with dynamic range { R [i] C [j] : R[i] C [j+10] }

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Frob first, tweak later

  3. #3
    Registered User
    Join Date
    10-13-2016
    Location
    India
    MS-Off Ver
    MS 2013
    Posts
    3

    Re: Macro for countif with dynamic range { R [i] C [j] : R[i] C [j+10] }

    Getting a run time error '1004'. Removed zero in Resize and it worked. Thanks a lot

+ 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. [SOLVED] Countif Dynamic Range
    By ajw089 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-04-2016, 05:25 PM
  2. [SOLVED] Help with offest and countif (Dynamic range)
    By LEEDA12345 in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 02-21-2014, 10:13 AM
  3. Using COUNTIF with a dynamic range
    By ruthjames in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-25-2013, 11:20 AM
  4. COUNTIF: dynamic range
    By BATISTAJM in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-22-2013, 07:17 PM
  5. Offset and Countif with dynamic Range
    By JKK123 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-22-2013, 12:15 AM
  6. Dynamic Range using Offset and CountIF
    By mark_jam3s in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-04-2008, 11:43 AM
  7. Offset, Dynamic range, Countif
    By Bryce in forum Excel General
    Replies: 3
    Last Post: 10-26-2005, 08:05 AM

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