+ Reply to Thread
Results 1 to 2 of 2

VBA/Macro to delete cell values if equal to another cell

  1. #1
    Registered User
    Join Date
    10-18-2014
    Location
    Ontario, Canada
    MS-Off Ver
    2013
    Posts
    30

    VBA/Macro to delete cell values if equal to another cell

    Hello and thank you for any help that you can give me.

    So i would like a macro that would delete cell values from column A when I enter a value (I use a scanner which when a bar code is scanned it automatically hits enter) in cell D1

    After that to delete the cell D1 and go back to it so I can scan another one in.

    Basically I ship some Items and every day I export a list of order numbers (which can contain duplicates because one order may have more than on package but still have the order number) and i would like an easier way of making sure that all the orders have been processed.

    Also is it possible to have a message box appear if the value of the scanned order is not in column A as this my becuase it was missed the day before or it is one to be processed for the next day.

    Is this possible or would another way be required.

    Untitled.png

    as an example of the layout

    I know a little VBA as i would eventually the D1 and put it on another sheet and after it if finished bring all the missing orders onto anther sheet also to make it more user friendly as I am not always the one doing it.

    Once again thank you for any help that you can offer
    Last edited by John Swift; 10-28-2014 at 03:28 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: VBA/Macro to delete cell values if equal to another cell

    as you are messing up with data, copy sheet1 to sheet2 also to preserve the data is something goes wrong

    suppose data in sheeet is like this

    1
    2
    3
    4
    5


    now right click the tab of sheet1 and click view code.
    in the window that comes up copy this EVENT CODE

    Please Login or Register  to view this content.
    now type in D1 some number existing in column A or not and see what happens

    if the D1 value exists in col A that entry in columA will be cleared
    if what you type in D1 is not available in column A the a message will pop up
    click ok
    I am not an expert. better solutions may be available
    [email protected]

+ 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: 5
    Last Post: 06-12-2014, 02:48 PM
  2. Macro code to delete entire row if cell in column A is equal to a value
    By mm671750 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-07-2014, 02:54 PM
  3. Delete Row if equal to Cell
    By Dnass in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-13-2013, 01:13 AM
  4. Replies: 14
    Last Post: 09-04-2013, 12:01 PM
  5. Delete rows with cell values equal to or greater than current week number
    By Pradeep M B in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-22-2013, 09:39 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