Results 1 to 2 of 2

Thread: search in cells to find any instance of words

  1. #1
    Member
    Join Date
    Jul 06
    Posts
    41

    search in cells to find any instance of words

    I'm trying to search through a list of company names which include universities and states. I want to eliminate any instance of the word "university" or "state of", regardless of where it occurs in the cell. How would I go about doing that?

  2. #2
    Frenzied Member zaza's Avatar
    Join Date
    Apr 01
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,484

    Re: search in cells to find any instance of words

    Use the Find method (shown in my Excel Tips and Tricks link) using the argument LookAt:=xlPart to do the search, then just use Replace or Instr to rewrite teh string. Then use FindNext (see VBA Help) to keep searching...


    zaza
    I use VB 6, VB.Net 2003 and Office 2010



    Code:
    Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA,VB.Net) | Coordinates, Vectors and 3D volumes

Posting Permissions

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