+ Reply to Thread
Results 1 to 12 of 12

delete entire row by vba

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

    delete entire row by vba

    Hi Experts,
    I am looking for a macro that will do the below things

    Macro will be placed in macro.xlsm(so we have to open abc by a macro)
    If column E matches with Column F then delete that entire row by vba
    and save the changes & close the workbook
    File ABC.xls may be located anywhere in the pc, so plz hardcode the path in the macro,so that i can change it as per my needs in future

    Thnx For the Help

    Sample file attached below

    Hi Experts,
    I am looking for a macro that will do the below things

    Macro will be placed in macro.xlsm(so we have to open abc by a macro)
    If column B of DEF.xlsx matches with Column I of ABC.xls then delete that entire row
    and save the changes & close the workbook
    File ABC.xls & DEF.xlsx may be located anywhere in the pc, so plz hardcode the path in the macro,so that i can change it as per my needs in future

    Thnx For the Help

    Sample file attached below
    Attached Files Attached Files
    Last edited by davesexcel; 07-14-2020 at 11:29 AM.

  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: delete entire row by vba

    Macro will be placed in macro.xlsm(so we have to open abc by a macro)
    Why not use Personal.xlsb for your macros. See this link. It will save you from having to open file to run the macro. With Personal.xlsb, you can run macros on already open files.

    https://www.rondebruin.nl/win/personal.htm
    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

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

    Re: delete entire row by vba

    Thnx for showing ur Great interest in this post AlanSidman Sir
    I also know the macro to open a file by vba & save it too.. but i dont know vba completely Sir, So i tried to mention all the details in the post, So it should be easy for them to understand what exactly the needs is

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

  5. #5
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: delete entire row by vba

    For the first request in file ABC, here is code that will open a file ABC from some directory and then compare colmns E and F and delete that row if those values are equal. The code should be placed in the personal file as mentioned above.
    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: delete entire row by vba

    On the second request above, dealing with ABC AND DEF, when a match is found, should the row be deleted from ABC? file?

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

    Re: delete entire row by vba

    thnx maniacb for helping me in solving this problem
    Have a Awesome Day

  8. #8
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: delete entire row by vba

    I have been advised to only delete columns from the bottom up, so I have updated the ABC code above. The For loop line please replace:

    Please Login or Register  to view this content.
    To

    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: delete entire row by vba

    Thnx Bro For ur Great Help maiacb

  10. #10
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: delete entire row by vba

    Is the second question about DEF and ABC rows deleted no longer required and replaced by your subsequent request https://www.excelforum.com/excel-pro...ow-by-vba.html

    If so, please mark this thread as solved.

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

    Re: delete entire row by vba

    Yes I done the same maniacb Sir
    This is also solved & that question is also solved & i marked both the threads as Solved
    Sorry for the Trouble
    Thnx Alot for helping me in solving the same Maniacb Sir

  12. #12
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: delete entire row by vba

    No trouble, I am glad it has worked out for you!

+ 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 if delete word is present
    By MoldyBread in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-10-2020, 12:02 PM
  2. iCell.EntireRow.Delete not working. Need code to Delete Entire Row
    By unit285 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 05-27-2017, 10:48 PM
  3. [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
  4. VBA code to delete the FILTERED range and moving the cell up (dont Delete entire row)
    By mchilapur in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-14-2015, 07:48 AM
  5. Replies: 4
    Last Post: 10-12-2014, 08:54 AM
  6. [SOLVED] Delete cell only with certain critria. Don't want to delete entire row, the celsl only
    By RobertOHare in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-16-2013, 04:18 AM
  7. Delete entire row when cell says delete
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-27-2007, 11:46 AM

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