Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    May 2003
    Location
    N. Andover, Massachusetts, USA
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Deleting Multiple Columns Macro (Excel 2000)

    I frequently have to import data from a comma delimited file. Wheen the data comes in some 160 columns. About about 60 columns are empty. I would like to find a Macro to delete any empty columns within a given range. It takes too long to click skip on each column in the import wizard. Any help would be greatly appreciated. Thank-you

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Deleting Multiple Columns Macro (Excel 2000)

    Where the 'given range' is preselected by the user:

    Sub DeleteBlankCols()
    Dim intC As Integer
    For intC = Selection.Column + Selection.Columns.Count To Selection.Column Step -1
    If Application.WorksheetFunction.CountBlank(Columns(i ntC)) = _
    Application.Rows.Count Then Columns(intC).Delete Shift:=xlToLeft
    Next intC
    End Sub
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •