+ Reply to Thread
Results 1 to 6 of 6

deleting Column Headers

  1. #1
    Forum Contributor
    Join Date
    02-27-2020
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    425

    deleting Column Headers

    I would like te have a macro that deletes the table headers in range(I1:L1) of the table. I referred to the table as listobjects(1). I don't know if this is the right way to do it.
    How can i do this?

    Any input is much appreciated!

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: deleting Column Headers

    Do you just want to delete the headers or the entire table columns?

    If the whole columns then this one liner should do it:
    Please Login or Register  to view this content.
    BSB

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: deleting Column Headers

    Haven’t tried to test your code but I think, if it's a structured table, you won't be able to get rid of headers completely. Excel will "auto name" the columns as Column 1, Column 2, etc.

    You'd probably need to convert the table to a normal range first.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    02-27-2020
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    425

    Re: deleting Column Headers

    The code from BadlySpelledBuoy does the job for me. Thank you.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,836

    Re: deleting Column Headers

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

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

    Re: deleting Column Headers

    @ MaartenRo

    If these BSN-numbers are genuine I strongly urge you to remove your example file from this public forum.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

+ 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. Filter Data Set using Row Headers in lieu of Column Headers
    By bsnell in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-30-2019, 11:43 AM
  2. Replies: 1
    Last Post: 02-03-2016, 02:33 AM
  3. [SOLVED] listbox with column headers as a specific sheet column headers
    By ANDREAAS in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-07-2014, 04:40 AM
  4. deleting columns with headers not contained in a list
    By excelfuchs in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-31-2013, 10:11 AM
  5. Replies: 3
    Last Post: 09-11-2012, 02:19 AM
  6. Replies: 2
    Last Post: 05-09-2012, 01:30 PM
  7. comparing the column headers, then deleting the entire column iif duplicates occur
    By vindieselgal in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-25-2011, 04:53 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