+ Reply to Thread
Results 1 to 2 of 2

variable range in a COUNTIF statment

  1. #1
    Sabean
    Guest

    variable range in a COUNTIF statment

    The position of the cells which have the data I want to check, change
    depending on certain criteria. Is it possible in VBA to create a flexible
    COUNTIF statement, where the range is a range object or something similar?
    What is the sintax? Thanks

  2. #2
    Tom Ogilvy
    Guest

    RE: variable range in a COUNTIF statment

    Dim rng as Range, cnt as Long
    With Worksheets("sheet1")
    set rng = .Range(.cells(5,1),.cells(5,1).End(xldown))
    End With
    cnt = Application.countif(rng,"AA")

    --
    Regards,
    Tom Ogilvy


    "Sabean" wrote:

    > The position of the cells which have the data I want to check, change
    > depending on certain criteria. Is it possible in VBA to create a flexible
    > COUNTIF statement, where the range is a range object or something similar?
    > What is the sintax? Thanks


+ 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