+ Reply to Thread
Results 1 to 5 of 5

delete whole column based on content of value row 1

  1. #1
    Registered User
    Join Date
    07-16-2013
    Location
    Prague
    MS-Off Ver
    Excel 2007
    Posts
    8

    delete whole column based on content of value row 1

    Hello everyone,

    I'm facing an issue with a macro I'm writing.

    Input is an extensive database of customer information. Some of the columns contain a character (currently underscore, but can be anything) that marks the column for deletion using the macro.

    The macro should cycle through all column names (row 1), and if the column name contains "_", it would delete the whole column and proceed to the next column.

    It sounded easy to me at first but I can't figure it out on my own.

    Thanks in advance for any help!

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: delete whole column based on content of value row 1

    If this does not work, I need to see your sample.

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: delete whole column based on content of value row 1

    Hi
    Cut and past the following code into a Module in your workbook and it should do the trick (based on an underscore being your criteria):

    Please Login or Register  to view this content.
    Good luck.
    Tony

  4. #4
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: delete whole column based on content of value row 1

    with explanation

    Please Login or Register  to view this content.
    If you like my contribution click the star icon!

  5. #5
    Registered User
    Join Date
    07-16-2013
    Location
    Prague
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: delete whole column based on content of value row 1

    Thanks a lot guys, the macro now works flawlessly.

+ 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. How to delete all content in a row based on a column's content
    By mccalljohn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-01-2011, 12:05 AM
  2. Delete rows based on cell content
    By scaffdog845 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 05-06-2010, 07:34 PM
  3. Delete Rows based on content
    By fmluder93 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 01-09-2009, 05:14 AM
  4. Delete Row Based On Cell Content
    By amsnss in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-28-2008, 02:01 PM
  5. [SOLVED] Delete Row based off cell content
    By Chuck Neal in forum Excel General
    Replies: 3
    Last Post: 03-29-2006, 03:55 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