+ Reply to Thread
Results 1 to 5 of 5

Delete multiple columns by column name no criteria need, just delete them

  1. #1
    Valued Forum Contributor
    Join Date
    04-11-2006
    MS-Off Ver
    2007
    Posts
    438

    Delete multiple columns by column name no criteria need, just delete them

    Hello All,

    I would like a macro to find the columns named "apple" and "peach" and delete them. These would always be in row 1 but would always be in different column letters which is why I want the macro to simply find these columns by their name and not by their column letter.

    And yes, I do mean the entire column altogether, shifting entire columns to the left. Wipe it off the face of the earth

    Thanks!
    Last edited by duugg; 06-24-2009 at 10:41 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Delete multiple columns by column name no criteria need, just delete them

    Perhaps along the lines of:

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    04-11-2006
    MS-Off Ver
    2007
    Posts
    438

    Re: Delete multiple columns by column name no criteria need, just delete them

    Worked perfectly Donkeyote, thanks!


    Just so I can learn from this..I have a question...

    What difference would the macro make if this line of code

    Please Login or Register  to view this content.
    were changed to this line of code?

    Please Login or Register  to view this content.
    What affect, if any would there be if the "Public" were taken out?
    What advantage is there to having "Public" in there?
    What dis-advantage is there to having "Public" in there, if any?

    Thanks

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Delete multiple columns by column name no criteria need, just delete them

    If the scope is not set (neither Private nor Public) the module is by default Public so hopefully that answers all of your questions in one go... if you want to read more you could search for Scope in VBE Help files and/or Google where you will find lots of material put together by people far more knowledgeable than I.

  5. #5
    Valued Forum Contributor
    Join Date
    04-11-2006
    MS-Off Ver
    2007
    Posts
    438

    Re: Delete multiple columns by column name no criteria need, just delete them

    Okay, thanks much

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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