+ Reply to Thread
Results 1 to 4 of 4

VBA Code to Delete Rows of Data if Cells Contain the Same Value From Another Sheet

  1. #1
    Registered User
    Join Date
    05-30-2014
    Posts
    17

    VBA Code to Delete Rows of Data if Cells Contain the Same Value From Another Sheet

    Hello,

    I am new to VBA and will like to seek help in writing a macro.
    I have got a set of data in a workbook with Sheet 1 range A1 to K373 and a range of data in Sheet 2 ranging from A1 to A30. What I will like to do is to have a VBA code to loop through all the cells in Sheet 1 column C and check which are the cells which value matches those in Sheet 2. Those that matches in Sheet 1 will have the entire row deleted. I have come out with the following codes but it does not work and hope to have someone here to guide me through.

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 05-30-2014 at 10:34 AM.

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA Code to Delete Rows of Data if Cells Contain the Same Value From Another Sheet

    Please use code tags when posting.

    Maybe:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-30-2014
    Posts
    17

    Re: VBA Code to Delete Rows of Data if Cells Contain the Same Value From Another Sheet

    Hey John,

    Got it. Thank you so much, it worked!

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA Code to Delete Rows of Data if Cells Contain the Same Value From Another Sheet

    You're welcome. Glad to help out and thanks for the feedback. Please comply with Forum Rule No. 9.

    9. Acknowledge the responses you receive, good or bad. If your problem is solved, please say so clearly, and mark your thread as Solved: Click Thread Tools above your first post, select "Mark your thread as Solved". Or click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Dropdown option or Edit button will not appear -- ask a moderator to mark it.

+ 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. Changing code from deleting rows to cut/paste rows into another sheet and delete blank row
    By kmarshall6576 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-18-2013, 01:54 AM
  2. [SOLVED] Delete rows with #N/A values on my sheet using VBA code
    By joh46k in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-03-2013, 10:38 PM
  3. [SOLVED] Code to quickly delete rows in sheet
    By shinichi_nguyen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-20-2012, 01:50 PM
  4. Code to delete rows containing names from a list on another sheet
    By eglassburn in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-23-2011, 12:52 PM
  5. [SOLVED] Code to delete rows and column cells that have formulas in.
    By GarToms in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-18-2006, 02:40 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