+ Reply to Thread
Results 1 to 3 of 3

Find in range

Hybrid View

  1. #1
    Registered User
    Join Date
    11-13-2006
    Posts
    11

    Find in range

    Using VBA I want to find how many times an occurance of a text string happens.

    ie. how many "HPPL" are within B4:G13, it would be nice too if case didn't matter, I may have to test for both though.

    Is there a countif in VBA?

    Ron

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Ron,

    You can envoke most of Excel's worksheet functions trough Excel. CountIf is one of them.

      Dim Cnt As Long
      Dim Rng As Range
      
        Set Rng = Worksheets("Sheet1").Range("B4:G13")
        Cnt = Application.WorksheetFunction.CountIf(Rng, "HPPL")
    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    11-13-2006
    Posts
    11
    Thank you very much, I have finished my sheet!!!

    One more thing I woudn't mind adding as a nice touch, is there a way to find out if the worksheet has been printed?

    Ron

+ 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