+ Reply to Thread
Results 1 to 3 of 3

Delete Entire Column if do not contain

  1. #1
    Registered User
    Join Date
    04-15-2009
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    43

    Delete Entire Column if do not contain

    Hi there,

    Having an issue I can't seem to sort through.

    100 columns.

    I have 50 values that I want to keep.
    All others to be deleted

    Example to want to keep: Child1AgeNow3
    But there are other like Child1AgeNow3.TM, Child1AgeNow3.RN which I still want to keep

    Want a script to go through all columns and delete it if it doesn't contain specific text from an array.

    Example array: Child1AgeNow3*, Child1Gender2*, etc etc

    Can anyone give me an assist here?

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Delete Entire Column if do not contain

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Valued Forum Contributor saravnepali's Avatar
    Join Date
    01-14-2019
    Location
    Sydney Australia
    MS-Off Ver
    2010
    Posts
    447

    Re: Delete Entire Column if do not contain

    Try this

    This deletes columns that does NOT HAVE Child1AgeNow3* on the First row of the column, amend to adjust
    Please Login or Register  to view this content.
    If you think someone helped you, click on the "* Add Reputation" as a way to say thank you.

    If your problem is solved, go to Thread Tools and select Mark This Thread Solved

+ 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 column
    By Jovillanueva in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-20-2014, 01:46 AM
  2. [SOLVED] Delete entire row other than column A
    By SaraLynne in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-06-2013, 08:57 AM
  3. Delete Entire Column If
    By SteveG in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-17-2012, 07:13 AM
  4. [SOLVED] CANNOT DELETE AN ENTIRE COLUMN
    By ibeetb in forum Excel General
    Replies: 4
    Last Post: 06-22-2006, 10:00 PM
  5. CANNOT DELETE AN ENTIRE COLUMN
    By ibeetb in forum Excel General
    Replies: 0
    Last Post: 06-21-2006, 12:35 PM
  6. CANNOT DELETE AN ENTIRE COLUMN
    By ibeetb in forum Excel General
    Replies: 0
    Last Post: 06-21-2006, 12:32 PM
  7. [SOLVED] Entire Column Delete
    By ermeko in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-28-2005, 10:06 AM

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