+ Reply to Thread
Results 1 to 12 of 12

Macro Correction to delete entire row

  1. #1
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Macro Correction to delete entire row

    Hi,
    The below macro is working fine, But if 1.xls or Error.xlsx has a blank sheet (No data in the sheet ) then this macro is creating error(In that case we don't want any error, it should do nothing in that case)
    Please Login or Register  to view this content.
    Thnx For the Help

  2. #2
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: Macro Correction to delete entire row

    Maybe some error handling... 'on error exit sub' or an 'on error resume next'?

  3. #3
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Re: Macro Correction to delete entire row

    Yes Croweater I know & i can do that But i don't want to do it
    there are many other ways also to solve this problem instead of on error exit sub & on error resume next , So i am looking for the same Sir

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,168

    Re: Macro Correction to delete entire row

    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  5. #5
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Re: Macro Correction to delete entire row

    Sintek Sir any of the file can be be a blank file, ws Or Sh
    the code which u gave it will work only for Sh but for ws also line is needed

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,168

    Re: Macro Correction to delete entire row

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Re: Macro Correction to delete entire row

    Sintek Sir below which line i have to put this line Sir?

  8. #8
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,168

    Re: Macro Correction to delete entire row

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Re: Macro Correction to delete entire row

    One more error this macro has

    Error details:
    Run time Error 1004
    No cells were found


    highlighted line:
    .Range("I:I").SpecialCells(xlCellTypeBlanks).EntireRow.Delete

  10. #10
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,168

    Re: Macro Correction to delete entire row

    No not doing this anymore...Someone else can help....

  11. #11
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Re: Macro Correction to delete entire row

    Np Sintek Sir & Sorry for the same
    Actually i was not getting where the issue occured otherwise i shared the same info at the starting of this post

  12. #12
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Re: Macro Correction to delete entire row

    Please Login or Register  to view this content.

    Error details:
    Run time Error 1004
    No cells were found


    highlighted line:
    .Range("I:I").SpecialCells(xlCellTypeBlanks).EntireRow.Delete


    May be error.xlsx has a blank sheet Or 1.xls will only have headers (data in only first row & nothing else in the sheet) then in that case Don't do anything & no error msg should come
    Attached Files Attached Files

+ 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] Delete Entire row by vba (macro Correction)
    By dumdumbum in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 09-19-2020, 09:12 AM
  2. [SOLVED] Delete Entire row by vba (macro Correction)
    By dumdumbum in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-09-2020, 06:30 AM
  3. [SOLVED] Macro Correction (If condition matched in a column then delete that entire row)
    By quirkybox in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-24-2020, 11:19 AM
  4. [SOLVED] Macro Needed to Delete Entire Row if the Entire Row (Or Col A,B,C,D in row ) are blank
    By swade730 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-04-2016, 06:32 AM
  5. Replies: 4
    Last Post: 10-12-2014, 08:54 AM
  6. Macro to delete the entire row
    By Sindhuja in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-21-2008, 10:07 PM
  7. [SOLVED] Help! with Macro - delete entire row
    By Rashid in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-04-2006, 05:20 PM

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