+ Reply to Thread
Results 1 to 3 of 3

count if

  1. #1
    macamarr
    Guest

    count if

    I am counting text. Not having a problem getting a count but what I need to
    do is; if the given words font has a strikthrough format I do not want to
    include it in the count.

  2. #2
    Bob Phillips
    Guest

    Re: count if

    Then you need a UDF to identify that the text has a strikethrough and put
    this in a helper column, and count in that column, There is no function to
    get it directly.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "macamarr" <macamarr@discussions.microsoft.com> wrote in message
    news:6AC3A52C-2571-42EB-811C-17AB9CA60448@microsoft.com...
    > I am counting text. Not having a problem getting a count but what I need

    to
    > do is; if the given words font has a strikthrough format I do not want to
    > include it in the count.




  3. #3
    Jim May
    Guest

    Re: count if

    In your Worksheet code module paste in:

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
    Boolean)
    If Target.Font.Strikethrough = True Then
    Target.Font.Strikethrough = False
    Else: Target.Font.Strikethrough = True
    End If
    Target.Calculate
    Cancel = True
    End Sub

    In a Standard module paste in:

    Function CountAnyOpen(myRange)
    Application.Volatile
    For Each i In myRange
    If i.Cells.Font.Strikethrough = False Then
    mytotal = 1 + mytotal
    End If
    Next i
    CountAnyOpen = mytotal
    End Function

    then on your sheet (in an empty cell enter =CountAnyOpen(A1:A10) <Change
    accordingly - and format

    Double-click away (between A1 and A10)
    HTH




    "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
    news:u%233ssFuJFHA.2772@TK2MSFTNGP14.phx.gbl...
    > Then you need a UDF to identify that the text has a strikethrough and put
    > this in a helper column, and count in that column, There is no function to
    > get it directly.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "macamarr" <macamarr@discussions.microsoft.com> wrote in message
    > news:6AC3A52C-2571-42EB-811C-17AB9CA60448@microsoft.com...
    > > I am counting text. Not having a problem getting a count but what I need

    > to
    > > do is; if the given words font has a strikthrough format I do not want

    to
    > > include it in the count.

    >
    >




+ 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