+ Reply to Thread
Results 1 to 2 of 2

If cell contains red text in column I then delete row

  1. #1
    Registered User
    Join Date
    03-10-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1

    If cell contains red text in column I then delete row

    Hello,

    I'm new to the visual basic editor (I'm using Excel 2010) and need some help writing a macro. I have column I, which is the sum of columns A and B (first and last names of patrons), and I have used conditional formatting to identify all duplicates in column I with red text. I would now like a macro to find red text in column I and then delete the corresponding rows.

    I've been looking around on the web for a while and have cobbled together this code stolen from other people's macros:

    Please Login or Register  to view this content.
    When I run it, I get the following error:

    Run-time error '1004':
    Application-defined or object-defined error

    Excel doc is called "stupid mailing list.xlsm", sheet I want to run the macro on is called "voters".

    Hopefully that's enough info for somebody to give me a hand!
    Last edited by alansidman; 03-10-2014 at 10:19 AM. Reason: code tags added

  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
    23,982

    Re: If cell contains red text in column I then delete row

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between
    Please Login or Register  to view this content.
    tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (Because you are new to the forum, I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    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

+ 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. Run Macro Automatically When delete row , changes cell,delete column
    By elevisse in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-27-2012, 07:42 AM
  2. [SOLVED] Delete Cell Numbers of Column B From Column A (Column B Small and Column A too big)
    By it_electronics2000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-09-2012, 08:56 AM
  3. [SOLVED] Delete Cell Numbers of Column B From Column A (Column B Small and Column A too big)
    By it_electronics2000 in forum Excel General
    Replies: 4
    Last Post: 04-07-2012, 09:14 AM
  4. Delete row if cell in below column contains text
    By drmix in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-16-2010, 10:45 PM
  5. Delete the whole row if any cell in a certain column has certain text
    By duugg in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 11-04-2009, 04:56 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