+ Reply to Thread
Results 1 to 5 of 5

Need macro to delete entire row based on column name.

  1. #1
    Forum Contributor
    Join Date
    06-01-2015
    Location
    Chennai,India
    MS-Off Ver
    Microsoft Office 2021
    Posts
    146

    Need macro to delete entire row based on column name.

    Hi all,

    Please help me..

    Need a macro to delete the entire row if a column "Country " contains with the word "Apple".

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,888

    Re: Need macro to delete entire row based on column name.

    This vba assumes the column A is the column holding the values. Change up the code as necessary

    Option Explicit

    Please Login or Register  to view this content.
    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
    06-01-2015
    Location
    Chennai,India
    MS-Off Ver
    Microsoft Office 2021
    Posts
    146
    Thanks.. but I need to first search for the column name... becoz apple will come under the column country... the country coulmn may appear in A or D or X...this is my problem... I am not able write based on the column name..

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Need macro to delete entire row based on column name.

    Please Login or Register  to view this content.

  5. #5
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Need macro to delete entire row based on column name.

    Myself I prefer using autofilter in order to get rid of all rows in one go i.e.

    Please Login or Register  to view this content.
    Alf

+ 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 to Delete Entire Row Based on Formula in Given Column
    By datutt in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-19-2015, 10:12 PM
  2. How to efficiently delete entire rows based on duplicates in one column
    By HughManatee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-16-2013, 06:53 PM
  3. [SOLVED] Marco to delete entire row based on value in specific column
    By djm601 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-17-2013, 12:53 PM
  4. Replies: 3
    Last Post: 04-19-2012, 10:45 AM
  5. Macro to delete entire row based on cell contents
    By ATX in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-06-2011, 03:52 AM
  6. macro to delete entire row based on TWO cell values
    By uncleslinky in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-05-2011, 02:42 PM
  7. 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

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