+ Reply to Thread
Results 1 to 5 of 5

VBA Macro To Clear Cell When Specific Text Is Entered

  1. #1
    Registered User
    Join Date
    11-26-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2003
    Posts
    8

    VBA Macro To Clear Cell When Specific Text Is Entered

    I currently use the following code to clear certain cells at a time interval of 2 seconds:


    Please Login or Register  to view this content.
    However I would like to clear the cell whenever the cell contains a specific word, ie Total. The cell is updated automatically from another source.

    Is there an easy way to change this?

    Many Thanks For Any Help!

    Paul
    Last edited by JBeaucaire; 01-13-2014 at 07:10 PM. Reason: Added missing CODE tags, please read and follow the Forum Rules, link in the menu bar above. Thanks.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Try this !

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: VBA Macro To Clear Cell When Specific Text Is Entered

    Marc's code will work if you have a single cell. However, if you want to test against a range you are going to need to incorporate a loop. Just out of curiosity, why are you clearing the cells every 2 seconds

    Please Login or Register  to view this content.
    Last edited by stnkynts; 01-13-2014 at 11:05 PM.

  4. #4
    Registered User
    Join Date
    11-26-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: VBA Macro To Clear Cell When Specific Text Is Entered

    Hi. Thanks a lot for replying!

    However the code is clearing the cell whenever any text is entered in the cell. Why would this be?

    Many thanks again!

    Paul

  5. #5
    Registered User
    Join Date
    11-26-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: VBA Macro To Clear Cell When Specific Text Is Entered

    Not to worry! Managed to sort it. If anyone is interested this is the final code that I have used.

    Please Login or Register  to view this content.
    Last edited by paulm99; 01-14-2014 at 06:55 PM.

+ 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: 4
    Last Post: 11-26-2012, 05:21 AM
  2. Display msgbox when specific text entered in specific range
    By Ali_Riza in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-20-2012, 08:05 AM
  3. Macro to Save As and clear cells data was entered
    By lfmemp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-13-2012, 12:14 AM
  4. When a date entered on a specific cell, automatically enter a text in other cell
    By mmccra2858 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-13-2012, 09:57 AM
  5. 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

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