Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Mar 2003
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Count text (2003)

    Hi there,
    I am trying to create a cell which will total the instances of particular text within a column on the same workbook. The text is "COMMUTER 3.0DSL MANUAL BUS" for example. I thought there was a function that I could use, but I can only find one that could be used for numerical data rather than text data.
    Any advice appreciated.

    Bill

  2. #2
    3 Star Lounger
    Join Date
    Feb 2003
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Count text (2003)

    If you want to use vba:
    ----Assuming you want to count you text in range D1100 and place the Count in A1
    ----Adjust as needed

    Option Explicit

    Sub CountText()
    Dim MyText as String
    Dim oCell as Range

    MyText = "COMMUTER 3.0DSL MANUAL BUS"
    For each oCell in Range("D1100")
    If oCell = MyText then
    Range("A1") = Range("A1") +1
    End if
    Next oCell
    End Sub

  3. #3
    2 Star Lounger
    Join Date
    Mar 2003
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Count text (2003)

    Thanks Paul,
    I'm not a big user of VBA but eventually worked it out using a function. This one actually:

    =COUNTIF(I1:I1808,"COMMUTER 3.0DSL MANUAL BUS")

    Thanks for your help.

    Bill

Posting Permissions

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