Results 1 to 2 of 2

Thread: Removing lines in excel

  1. #1

    Thread Starter
    Junior Member crazyska's Avatar
    Join Date
    Jun 2010
    Location
    Tampa, FL
    Posts
    17

    Removing lines in excel

    What would be a good marco to write so i could remove blank lines in excel. For example i have a sheet with all the colums filled up then down at 47 it blank all the way accross listing the totals. I want to write something that deletes that line and the total txt. Im sure its simple I am completely new to doing this

  2. #2

    Thread Starter
    Junior Member crazyska's Avatar
    Join Date
    Jun 2010
    Location
    Tampa, FL
    Posts
    17

    Re: Removing lines in excel

    Nvm I figured it out

    Sub DeleteEmptyRowsMain()
    Dim myColm As Range
    Dim LastCell As Range
    Set myColm = Application.InputBox("Choose Start of column to clear", Type:=8)
    Set LastCell = Cells.Find("*", , , , , xlPrevious)
    On Error Resume Next
    If Not myColm Is Nothing Then
    Range(myColm, Cells(LastCell.Row, myColm.Column)).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    Else
    MsgBox "No Range Selected", vbOKOnly, "Error"
    End If

    End Sub

Posting Permissions

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



Click Here to Expand Forum to Full Width