+ Reply to Thread
Results 1 to 4 of 4

looking for a code that will clear cell value if cell contains certian text

Hybrid View

  1. #1
    Registered User
    Join Date
    06-24-2015
    Location
    Vermont
    MS-Off Ver
    2010
    Posts
    50

    looking for a code that will clear cell value if cell contains certian text

    what im looking to do is have a code that runs and looks in row 1 of sheet1 and if a cell contains "Char" (and could also have something else like "Char3" or Char12") then it deletes that cell value thank you

  2. #2
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: looking for a code that will clear cell value if cell contains certian text

    Perhaps something like this

    Option Explicit
    
    Sub DeleteChar()
    
       Dim r As Range
       
       For Each r In ActiveSheet.UsedRange.Rows(1).Cells
            If r.Value Like "Char*" Then
                r.Value = vbNullString
            End If
       Next r
        
    End Sub
    Thanks

  3. #3
    Registered User
    Join Date
    06-24-2015
    Location
    Vermont
    MS-Off Ver
    2010
    Posts
    50

    Re: looking for a code that will clear cell value if cell contains certian text

    perfect! thank you

  4. #4
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: looking for a code that will clear cell value if cell contains certian text

    I am glad I was able to help

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 06-18-2015, 07:58 PM
  2. [SOLVED] Hide cell if certian cells equal a certian criteria
    By namluke in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-22-2014, 09:39 AM
  3. [SOLVED] Code to clear cell contents
    By Nitefox in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 12-15-2013, 10:29 PM
  4. Macro to clear a particular cell based on the text in another cell.
    By saidineshbabu in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-16-2013, 01:38 PM
  5. [SOLVED] How to determine if a cell has certian text for first three characters
    By proepert in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-10-2012, 10:20 PM
  6. Macro that will clear contents of cell based on format of text in adjacent cell
    By judasdac in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-12-2012, 01:56 AM
  7. Clear cell (VBA code)
    By Sharp in forum Excel General
    Replies: 4
    Last Post: 01-15-2007, 05:16 PM

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