Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Removing blank lines in a workbook
I am trying to use code that was listed in a previous newsgroup posting to
remove blank lines on a worksheet. Is there a way to set this up as a macro that would work for all worksheets in the workbook? I am not very knowledgeable with VB language. Below is the posting I have followed so far. It works for 1 worksheet, but not for the entire workbook. Thanks for any help. I have assumed that if the cell in column A is empty then this identifies a blank row. If that is correct then right click the sheet tab, view code and paste this in:- Sub surface() With ActiveSheet LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row End With For x = LastRow To 1 Step -1 Cells(x, 1).Select If Cells(x, 1).Value = "" Then Selection.EntireRow.Delete End If Next End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to delete Blank lines in excel workbook? | Excel Discussion (Misc queries) | |||
How do I print lines in a blank workbook? | New Users to Excel | |||
Removing zero value lines | Excel Worksheet Functions | |||
Copying and pasting a worksheet to a blank and removing blank rows | Excel Programming | |||
how to automatically insert blank lines in between non-blank lines | Excel Programming |