+ Reply to Thread
Results 1 to 6 of 6

Macro to Delete columns in different sheets within a workbook

  1. #1
    Registered User
    Join Date
    09-17-2008
    Location
    Europe
    Posts
    48

    Macro to Delete columns in different sheets within a workbook

    Hi,

    I would like to delete specific columns in 'sheet 1' and another set of columns in 'sheet 2', 'sheet 3' etc...

    Example:

    In 'sheet 1', i would like to deleted columns: B, D, F, G, H, P
    In 'sheet 2', i would like to deleted columns: B, E, M, P, R, T
    In 'sheet 3', i would like to deleted columns: B, C, S, U, X

    Please note that i'm working on Excel 2010.


    regards,

  2. #2
    Forum Contributor
    Join Date
    06-07-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: Macro to Delete columns in different sheets within a workbook

    Try

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-17-2008
    Location
    Europe
    Posts
    48

    Re: Macro to Delete columns in different sheets within a workbook

    Thanks.

    Is it possible to re-write the code so that a range of columns can be deleted. What i mean is, instead of "F1,G1,H1" is it possible to write as "F1..H1"?

  4. #4
    Forum Contributor
    Join Date
    06-07-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: Macro to Delete columns in different sheets within a workbook

    Yes, like this

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-16-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Macro to Delete columns in different sheets within a workbook

    How would you modify this to make it apply to all sheets regardless of how many there are? for example delete columns L, M, N, Q, R, T... from all sheets in the workbook.

  6. #6
    Forum Contributor
    Join Date
    06-07-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: Macro to Delete columns in different sheets within a workbook

    Try

    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)

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