+ Reply to Thread
Results 1 to 7 of 7

apply countif formula acorss multiple worksheets

  1. #1
    Registered User
    Join Date
    10-25-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    11

    apply countif formula acorss multiple worksheets

    Hi

    I'm really struggling with an earlier macro and not understanding why macro is not working, so will have to create a workaround.

    I need to apply a countif formula to count the number of blank rows in a range B16 to B22 and return the count in cell B1 in each worksheet. There will be numerous worksheets in each workbook.

    Is this easy to do?

    many thanks

    Gary
    Last edited by WeeG; 10-31-2012 at 09:57 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: apply countif formula acorss multiple worksheets

    You can do this manually or you can do this via macro.

    If you want to do it manually, do the following -
    Select all the sheets in your file. While keeping them selected, enter this formula in B1
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    10-25-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: apply countif formula acorss multiple worksheets

    thanks, how would i input the code if i wanted it inserted into a macro?

    thanks

    Gary

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: apply countif formula acorss multiple worksheets

    Here you go -
    Please Login or Register  to view this content.
    Put it in a standard module.
    Last edited by arlu1201; 10-31-2012 at 08:07 AM.

  5. #5
    Registered User
    Join Date
    10-25-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: apply countif formula acorss multiple worksheets

    Hi

    thanks for this.

    I did get an error - run time error 438 - object doesn't supprt this property or method.

    with this line
    Worksheets(i).Range("B1").FormulaR1C1 "=COUNTBLANK(R[15]C:R[21]C)"

    I also did give the wrong info, the countblank rows result should be in cell B1, but the range that should be used is H16:H22.

    Thanks

    Gary

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: apply countif formula acorss multiple worksheets

    There was a small typo in my code above which i corrected now. But considering your change in columns, here is the updated code
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-25-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: apply countif formula acorss multiple worksheets

    thanks, this is working great.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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