+ Reply to Thread
Results 1 to 3 of 3

How to delete columns (referring to column number)?

  1. #1
    Forum Contributor VAer's Avatar
    Join Date
    09-10-2016
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    803

    How to delete columns (referring to column number)?

    https://www.statology.org/vba-delete-column/

    Above code deletes column by referring to column letter.

    How should I delete column by referring to column number? For example, how can I delete first 5000 columns?

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,953

    Re: How to delete columns (referring to column number)?

    Range("a:a").Resize(columnsize:=5000).Delete
    Ben Van Johnson

  3. #3
    Forum Contributor VAer's Avatar
    Join Date
    09-10-2016
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    803

    Re: How to delete columns (referring to column number)?

    Quote Originally Posted by protonLeah View Post
    Range("a:a").Resize(columnsize:=5000).Delete
    Thank you!!

+ 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. Replies: 6
    Last Post: 12-20-2022, 02:32 PM
  2. Macro to delete certain columns and delete rows based on time in another column
    By beepbeep27 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2012, 11:47 AM
  3. Replies: 1
    Last Post: 10-25-2011, 07:43 AM
  4. sum column with restrictictions referring to other columns. How to do this?
    By zhoudiying in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-02-2011, 02:52 PM
  5. Replies: 4
    Last Post: 09-01-2010, 10:22 AM
  6. Referring to columns by number
    By SmithTS86 in forum Excel General
    Replies: 4
    Last Post: 04-20-2010, 10:59 AM
  7. VLOOKUP referring to columns to the left of the source column
    By makku in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-08-2008, 06:28 AM
  8. referring to a column by letter, not number
    By Deci in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-06-2007, 11:01 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