+ Reply to Thread
Results 1 to 4 of 4

Search Range and Return # of times a Text String occurs

  1. #1
    Registered User
    Join Date
    01-19-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    23

    Search Range and Return # of times a Text String occurs

    Hello,
    I am trying to write some VBA to search a column (ex A1:A100) and returns the number of times the word "Buy" occurs. So, for example, this would return a value of 3.
    Also, I cannot add anything to the spreadsheet itself. I need to have it solely within the VBA code.

    A
    1 Buy
    2 Sell
    3 Buy
    4 Buy
    5 Sell
    ...


    Thanks!

  2. #2
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: Search Range and Return # of times a Text String occurs

    Please Login or Register  to view this content.
    Last edited by AlvaroSiza; 05-02-2012 at 03:40 PM.

  3. #3
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Search Range and Return # of times a Text String occurs

    Please Login or Register  to view this content.
    Run: RunCountStringInRange
    Change: "buy", Range("A1:F10")

  4. #4
    Registered User
    Join Date
    01-19-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Search Range and Return # of times a Text String occurs

    Thank you both for your help! that did the trick. Have a great day.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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