+ Reply to Thread
Results 1 to 4 of 4

Want to Delete Specified Columns and then add Column header to the remaining ones

  1. #1
    Registered User
    Join Date
    03-01-2010
    Location
    Portland, OR
    MS-Off Ver
    Office 365
    Posts
    58

    Want to Delete Specified Columns and then add Column header to the remaining ones

    Hi!

    So I want to add some VBA Code that deletes specified columns and then insert Bolded Column headers to the remaining columns. The columns I want deleted are D,F,I,J,K. For simplicity purposes, the column headers would be A,B,C,D,E,F,G.

    I tried using Columns("D,F,I,J,K").delete but I kept on getting 13 error.

    Thanks for the help!

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

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Want to Delete Specified Columns and then add Column header to the remaining ones

    See comments in code:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-01-2010
    Location
    Portland, OR
    MS-Off Ver
    Office 365
    Posts
    58

    Re: Want to Delete Specified Columns and then add Column header to the remaining ones

    Much Appreciated! As for adding bolded Column headings, is there a straight forward way of handling that? I figured how to insert the blank row at the top, but wasn't sure how to add bolded text to each of the Columns.

    Thanks!
    Last edited by ppilot; 05-16-2014 at 12:23 PM.

  4. #4
    Registered User
    Join Date
    03-01-2010
    Location
    Portland, OR
    MS-Off Ver
    Office 365
    Posts
    58

    Re: Want to Delete Specified Columns and then add Column header to the remaining ones

    And I just figured out to do what I was asking in the previous post. Just in case some one in the future might use it, I've included the code I added.
    It's probably not the most efficient way of handling the problem but it works:

    Please Login or Register  to view this content.

+ 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. If column contains certain header, delete column--exempt certain columns
    By kestefon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2013, 04:04 PM
  2. Delete Columns Based on Header
    By MSmithson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-28-2010, 03:19 AM
  3. Macro to delete sheets and saves remaining file does not properly delete module
    By pherrero in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-21-2005, 08:12 PM
  4. Replies: 0
    Last Post: 06-21-2005, 01:05 PM
  5. Re: Macro to delete sheets and saves remaining file does not properly delete module
    By pherrero in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-21-2005, 01:05 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