Consulting

Page 2 of 2 FirstFirst 1 2
Results 21 to 24 of 24

Thread: Combine Formula

  1. #21
    VBAX Regular Reji Rajan's Avatar
    Joined
    Sep 2015
    Location
    Mumbai
    Posts
    24
    Location
    If not by color, then can the counter be triggered by a number or a text. for e.g,In my attached workbook, the first sheet is named as counter. In this sheet, Column E contains header called condition & the cells below either has text "TRUE" or number "1" in it. I know i can use count if condition to get the number of "1s" in between true but the problem is the data is never constant, i mean TRUE & 1 can be in any cell in that particular column and I specifically the count of "1s" between 2 "true" cells.

  2. #22
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    The Function in my previous post looks at the cells in Column 1 to do that, Enter that code in a standard module and enter
    =IF(LEFT(A2,2)<>"BB",ClrCount(A2),"")
    in Row 2 and copy down.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #23
    VBAX Regular Reji Rajan's Avatar
    Joined
    Sep 2015
    Location
    Mumbai
    Posts
    24
    Location
    I tried the function & it works brilliantly on an individual sheet (like the one i have pasted here)but there is a slight hindrance. This sheet is part of a macro enabled workbook, which i have made partly by recording macro & partly by adding codes. It allows me to add the code & the formula (=IF(LEFT(A2,2)<>"BB",ClrCount(A2),"") only in 1 cell. the moment i try drag the formula in the entire column, the workbook freezes & excel file is unresponsive. I have to forcefully exit the workbook. Am i missing some logic here or this code wont work with another macro enabled workbook. Also pardon my knowledge and sorry to sound like an oaf but can the count of cells be obtained without code and only by formula.

  4. #24
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    I suggest you mark this as solved post this part as a new question to get more input.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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