+ Reply to Thread
Results 1 to 6 of 6

Issues Trying to Delete Rows That are Copied into another sheet

  1. #1
    Registered User
    Join Date
    05-10-2022
    Location
    United States
    MS-Off Ver
    2020
    Posts
    10

    Question Issues Trying to Delete Rows That are Copied into another sheet

    Hi,

    I currently have a spreadsheet that is being populated by a dataflow. I have conditional formatting (through excel) set up so entire rows are highlighted red if the value in Column G is negative.

    The macro then auto filters this sheet to the cells highlighted in Red and copies those values over to another sheet in the workbook.

    After the values are copied, I want to delete them from this original table as the rest of the values are going to be copied into another sheet where I can't include the negative numbers.

    Every time I run the macro I get:

    Run-time error '1004': Delete method of Range class failed

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,021

    Re: Issues Trying to Delete Rows That are Copied into another sheet

    Can you post your workbook ?

  3. #3
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2405-17628.20102
    Posts
    1,404

    Re: Issues Trying to Delete Rows That are Copied into another sheet

    I think you may have issues with an empty table at times, try the below:
    Please Login or Register  to view this content.
    If things don't change they stay the same

  4. #4
    Registered User
    Join Date
    05-10-2022
    Location
    United States
    MS-Off Ver
    2020
    Posts
    10

    Re: Issues Trying to Delete Rows That are Copied into another sheet

    Quote Originally Posted by Logit View Post
    Can you post your workbook ?
    Workbook is attached - had to upload a copy with some columns removed, but this should be the same general idea.
    Attached Files Attached Files
    Last edited by rdubois98; 05-11-2022 at 12:08 PM.

  5. #5
    Registered User
    Join Date
    05-10-2022
    Location
    United States
    MS-Off Ver
    2020
    Posts
    10

    Re: Issues Trying to Delete Rows That are Copied into another sheet

    Quote Originally Posted by CheeseSandwich View Post
    I think you may have issues with an empty table at times, try the below:
    Please Login or Register  to view this content.

    Also, I tried adding in that code that was just added above and I am still getting the same error with the rang.EntireRow.Delete highlighted.

  6. #6
    Registered User
    Join Date
    05-10-2022
    Location
    United States
    MS-Off Ver
    2020
    Posts
    10

    Re: Issues Trying to Delete Rows That are Copied into another sheet

    Ended up solving this by replacing EntireRow.Delete with .Delete

    I also had to turn off Alerts to keep from having to click the "Are you sure you want to delete?" popup.

    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. [SOLVED] need rows on sheet two copied and inserted into sheet one after a specific text
    By C21THOMAS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-17-2021, 09:04 AM
  2. [SOLVED] Once a sheet is copied to another blank sheet how to delete a private sub checkbox
    By bdouglas1011 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2019, 03:59 AM
  3. Delete Repeated Rows In Table Copied From Word
    By Treeman_JF in forum Excel General
    Replies: 6
    Last Post: 11-01-2018, 09:12 AM
  4. Unable to delete sheet due to macros copied earlier - error 400
    By talhawahab in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-12-2012, 11:52 PM
  5. [SOLVED] Want to just Delete Command Buttons frm a Copied Sheet excluding ALL other Shapes ?
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-27-2012, 03:00 AM
  6. Using If to get corresponding rows copied to new sheet
    By aussieinus in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-24-2011, 11:53 AM
  7. Delete the formulas of webpage, copied & pasted on excel sheet
    By Mustafa Abedin in forum Excel General
    Replies: 1
    Last Post: 06-19-2005, 10:05 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