+ Reply to Thread
Results 1 to 2 of 2

VB Code to erase two cells as data changes in another

  1. #1
    Forum Contributor
    Join Date
    09-16-2013
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2011
    Posts
    620

    VB Code to erase two cells as data changes in another

    Im looking for code that will monitor the E column and whenever the user selects Return from the drop down list it checks to see if there is data in the corresponding I or J cell (on the same row). If so a message comes up letting them know this action will erase data in the 'Item Exchange' and Exchange Unit' cells (I and J). If the user clicks ok it erases those cells, if they cancel the E column goes back to whatever value it started with.
    Thanks,
    James

  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: VB Code to erase two cells as data changes in another

    Hi, James,

    usually you could use the Worksheet_Change-event for that but I think you already have used that event for monitoring other cells so you would need to integrate the code there as well.

    On itīs own the code may look like (please notice that there may only be one event of each name behind each single sheet):
    Please Login or Register  to view this content.
    Your exisiting procedure must be rewritten in order to accept this case as well.

    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

+ 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. [SOLVED] Macros code to erase data
    By Brainstorm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-10-2012, 09:06 PM
  2. Excel 2007 : erase cells
    By ALEZI in forum Excel General
    Replies: 5
    Last Post: 01-22-2010, 08:24 AM
  3. [SOLVED] Erase Code
    By Bill in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-04-2005, 03:06 PM
  4. Erase all drawing items with code
    By daniels012 in forum Excel General
    Replies: 0
    Last Post: 01-25-2005, 03:17 PM
  5. Code to erase certain data
    By daniels012 in forum Excel General
    Replies: 2
    Last Post: 01-11-2005, 05:34 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