+ Reply to Thread
Results 1 to 4 of 4

Clear a cell value when another cell changes

  1. #1
    Registered User
    Join Date
    07-01-2014
    Location
    India
    MS-Off Ver
    2007
    Posts
    3

    Clear a cell value when another cell changes

    I've been working on this very simplistic VB code. Please refer to the attached spread sheet. I need B15 to clear and display "select scenario" when A13 is changed. That works fine. I have the same routine for the next group of cells below but when I go to A17 and select the same code as A13 then B15 and B19 change, I don't want B15 to change anymore. This happens when I have the same value two or more times in the Colum named "code" please help, I'm an ag engineer and just starting to get familiar with VB.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Clear a cell value when another cell changes

    Hi, jrsegoviano,

    you should stop working with merged cells.

    Try:
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,464

    Re: Clear a cell value when another cell changes

    When use Change event code and needs to change any cell, you need to set EnableEvents property to False and set it back to True at the end.
    Otherwise unnecessary Change event will be called.
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    07-01-2014
    Location
    India
    MS-Off Ver
    2007
    Posts
    3

    Re: Clear a cell value when another cell changes

    Both Work great!

+ 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: 3
    Last Post: 08-16-2014, 09:55 AM
  2. [SOLVED] move down column and for every blank cell, clear contents of cell to the left
    By hopefulhart in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-01-2014, 11:23 AM
  3. Replies: 1
    Last Post: 06-21-2013, 04:05 AM
  4. Clear cell range on multiple sheets if cell on one sheet is modified.
    By bjg1016 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-12-2012, 02:39 PM
  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

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