C
Carole O
Excel 2003 SR2
I'm moving a large file into row range worksheets (5000 lines go into each
worksheet) which is then tested for blanks in Column B. If there are blanks
the row is deleted. Then I test to see if the worksheets past the 20000th
row are blank (B1 will always be blank if the whole worksheet is blank). If
true, delete the worksheet without displaying the warning.
My problem is the code (below) deletes the worksheet whether B1 is blank or
not ! I've cut and pasted other examples to get this formula and probably
did not cut enough or paste enough.
Any help would be appreciated!
CaroleO
If IsEmpty(Worksheets("20000").Range("B1")) Then
Application.DisplayAlerts = False
Sheets("20000").Delete
Application.DisplayAlerts = True
Else
Sheets("20000").Select
Columns("B:B").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Delete
End If
If IsEmpty(Worksheets("25000").Range("B1")) Then
Application.DisplayAlerts = False
Sheets("25000").Delete
Else
Sheets("25000").Select
Columns("B:B").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Delete
I'm moving a large file into row range worksheets (5000 lines go into each
worksheet) which is then tested for blanks in Column B. If there are blanks
the row is deleted. Then I test to see if the worksheets past the 20000th
row are blank (B1 will always be blank if the whole worksheet is blank). If
true, delete the worksheet without displaying the warning.
My problem is the code (below) deletes the worksheet whether B1 is blank or
not ! I've cut and pasted other examples to get this formula and probably
did not cut enough or paste enough.
Any help would be appreciated!
CaroleO
If IsEmpty(Worksheets("20000").Range("B1")) Then
Application.DisplayAlerts = False
Sheets("20000").Delete
Application.DisplayAlerts = True
Else
Sheets("20000").Select
Columns("B:B").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Delete
End If
If IsEmpty(Worksheets("25000").Range("B1")) Then
Application.DisplayAlerts = False
Sheets("25000").Delete
Else
Sheets("25000").Select
Columns("B:B").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Delete