+ Reply to Thread
Results 1 to 10 of 10

Delete Entire row by vba (macro Correction)

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

    Delete Entire row by vba (macro Correction)

    Please Login or Register  to view this content.

    I have a macro to do the same but it is not deleting the entire row so plz see & help me out in the same
    Attached Files Attached Files

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Delete Entire row by vba (macro Correction)

    What do you mean "It is not deleting entire row"? it only deletes part of the row?

  3. #3
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Delete Entire row by vba (macro Correction)

    dave probably knows more about me than this, however this was the code that you posted:
    Please Login or Register  to view this content.
    and some of the stuff that I see is:

    1) this code:
    Please Login or Register  to view this content.
    might be an issue? that doesn't necessary target an entire row, does it?

    https://docs.microsoft.com/en-us/dot...heet.usedrange

    2) this code:
    Please Login or Register  to view this content.
    doesn't need the colon and equal sign I don't think. this is fine:
    Please Login or Register  to view this content.
    3) this code:
    Please Login or Register  to view this content.
    whatever RowCount1 is, I don't think would matter because you are using ''i'' to delete the indexed row. so it doesn't make sense, to me anyway, that this deletion line of code would delete only part of a row. that code would be much more complex. moreover, because it involves shifting cells up/down/left/right after deletion of a range. however, what you might not have taken into account I suppose, is that, when you delete a row, the worksheet gets rearranged and if you are using a counter in a loop and that counter is pointing to row ''x'' and you increment that counter in the next iteration but you have deleted a row at the same time, things might get a tad bit confused because the row counter is not necessarily accurate anymore unless you have made the proper adjustments.

    hopefully this gives some help, aside from what dave said.
    Last edited by vba_php; 09-08-2020 at 04:21 PM.

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

    Re: Delete Entire row by vba (macro Correction)

    It is not deleting the entire row if condition is matched
    Plz run the macro on the sample file Sir

  5. #5
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Delete Entire row by vba (macro Correction)

    Quote Originally Posted by dumdumbum View Post
    It is not deleting the entire row if condition is matched
    Plz run the macro on the sample file Sir
    are you talking to everyone here?

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Delete Entire row by vba (macro Correction)

    As vba_php has mentioned, when deleting rows, it is best to start from the bottom and move up.

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

    Re: Delete Entire row by vba (macro Correction)

    Np but i need the macros Sir

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

    Re: Delete Entire row by vba (macro Correction)


  9. #9
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Delete Entire row by vba (macro Correction)

    Try this, change file location in code.

    Please Login or Register  to view this content.

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

    Re: Delete Entire row by vba (macro Correction)

    Thnx Alot Davesexcel Sir for Helping me in solving this problem
    Prpblem Solved
    Have a Awesome Day Sir

+ 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] 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
  2. [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
  3. Replies: 4
    Last Post: 10-12-2014, 08:54 AM
  4. How do you delete entire column with Macro?
    By geng in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-09-2010, 09:26 PM
  5. Delete entire row macro won't work
    By copaaz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-11-2010, 12:18 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