Results 1 to 9 of 9

remove cell contents if contains certain word in a specific column

Threaded View

  1. #1
    Registered User
    Join Date
    03-27-2013
    Location
    Wiltshire, England
    MS-Off Ver
    MS 365
    Posts
    84

    remove cell contents if contains certain word in a specific column

    I have this sub which makes the cell blank if the word "text" is found in it. This works across all columns.

    Sub ClearCellsContainingText()
    Do Until Cells.Find(What:="text", After:=ActiveCell, _
    LookIn:=xlFormulas, LookAt:=xlPart, _
    SearchOrder:=xlByRows, _
    SearchDirection:=xlNext, MatchCase:= _
    False, SearchFormat:=False) _
    Is Nothing

    Cells.FindNext.Clear
    Loop
    End Sub

    Can anyone alter this one slightly or give a new one so the instruction only looks at a certain column
    For example: I want any cell in column b to become blank if it contains the word "text".

    If the word "text" is found in any other columns then those columns stay as they are.
    Last edited by picton2000; 03-30-2013 at 05:10 PM. Reason: Problem solved

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