+ Reply to Thread
Results 1 to 3 of 3

I want to delete the 2,3,4 column in my spreadsheet

  1. #1
    Registered User
    Join Date
    07-08-2011
    Location
    Vanc
    MS-Off Ver
    Excel 2007
    Posts
    4

    I want to delete the 2,3,4 column in my spreadsheet

    Hi to all

    I have a lot of data on my spreadsheet. Out of all the data, i want to see the 1, 5, 9 column so on and so forth. How can i delete the the column 2,3,4, 6,7,8 etc.


    Thanks a lot

  2. #2
    Registered User
    Join Date
    07-18-2011
    Location
    DC, US
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: I want to delete the 2,3,4 column in my spreadsheet

    Try to run this for your workbook,

    Sub test1()

    For Each ws In Sheets

    Set myRange = ws.UsedRange
    For Each c In myRange.Rows(1).Cells

    If c.Column <> 1 And c.Column <> 5 And c.Column <> 9 Then
    Columns(c.Column).ClearContents
    End If

    Next

    Next


    End Sub

  3. #3
    Registered User
    Join Date
    07-08-2011
    Location
    Vanc
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: I want to delete the 2,3,4 column in my spreadsheet

    Hi shine

    I tried it but it didn't delete the actual column is it possible to do that?

    Thanks

+ 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