|
-
Jun 16th, 2010, 01:19 PM
#1
Thread Starter
Junior Member
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
-
Jun 16th, 2010, 03:11 PM
#2
Thread Starter
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|