+ Reply to Thread
Results 1 to 4 of 4

cell comparison macro

  1. #1
    Registered User
    Join Date
    03-07-2013
    Location
    new jersey
    MS-Off Ver
    Excel 2003
    Posts
    8

    cell comparison macro

    Hi all,

    I have whole number values in columns A B C D E, going from rows 1 to 1000. I would like to compare columns D and E. I would like a text box that asks what number i'd like to search for. Lets just say the number I want to find is 31. I would like it to then look in D1 for number 31 and if it is there to see if its ALSO in E1. If it is, and they both have 31 id like to delete the entire row(Ax:Ex), then move to the next line and do the same thing. How would the code look for that?

    Thanks

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    24,029

    Re: cell comparison macro

    Try this:

    Please Login or Register  to view this content.
    Last edited by alansidman; 11-21-2013 at 11:24 PM. Reason: ScreenUpdating.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    03-07-2013
    Location
    new jersey
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: cell comparison macro

    Thank you for such a fast response, it worked great!

    after doing that I thought of something else simple that would help me alot and I was wondering if there was a way to edit the code to do so.

    I wanted to have an input box that asks me what number id like to search for in column E. Lets say I search for 35. Then also another box that asks for a number im searching for in column D. Wherever it finds 35 in column E, it then looks next to it in column D and sees if that has the other number, say 28.

    so basically if it finds 35 in column E AND finds 28 in column D, it deletes the entire row (Ax:Ex). Does that make sense?

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    24,029

    Re: cell comparison macro

    Give this a try:

    Please Login or Register  to view this content.

+ 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. comparison macro
    By beatrice25 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 10-29-2008, 03:14 PM
  2. Comparison Macro
    By seanmartin26 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2006, 05:57 PM
  3. [SOLVED] RE: Comparison Macro
    By Tom Ogilvy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-26-2006, 01:20 PM
  4. Comparison Macro
    By aceensor in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-20-2005, 03:13 PM
  5. [SOLVED] Macro for a comparison
    By mike b in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-15-2005, 03:06 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