Results 1 to 15 of 15

Delete multiple columns in a Table

Threaded View

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,152

    Delete multiple columns in a Table

    This code works to delete multiple contiguous columns in a DataRange or in a Table.
    ActiveSheet.Range("A:C").EntireColumn.Delete Shift:=xlToLeft
    This code works to delete multiple discontiguous columns in a DataRange, but does NOT work on my Table (if I convert it to a range it works fine):
    ActiveSheet.Range("A:C,E:G").EntireColumn.Delete Shift:=xlToLeft
    How do I need to change the second code to delete multiple discontiguous columns in a Table? The actual columns I want to delete are as shown below, and BA is the last column of my table:
    Activesheet.Range("A:C,E:G,J:Q,U:AB,AD:AH,AJ:AR,AU:BA").Delete Shift:=xlToLeft
    Last edited by jomili; 05-26-2016 at 11:38 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA Delete Row If Ciriteria From Multiple Columns are Met
    By hobbiton73 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2014, 02:07 AM
  2. Add and Delete table columns without cells shifting?
    By brucemc777 in forum Excel General
    Replies: 3
    Last Post: 05-19-2014, 05:50 PM
  3. [SOLVED] Convert table with multiple header columns into a pivotable table
    By jasonleewkd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2013, 03:20 AM
  4. Replies: 9
    Last Post: 12-20-2012, 10:29 AM
  5. [SOLVED] Delete multiple empty cells in multiple columns and moving data up, witout Macros
    By CoraF in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-30-2012, 08:23 AM
  6. Delete multiple columns by column name no criteria need, just delete them
    By duugg in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-24-2009, 10:40 AM
  7. Delete multiple columns if they fit different criteria
    By duugg in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 06-23-2009, 02:36 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