G Guest Dec 25, 2006 #1 i have data with balnak rows and colums. i want to delete all blank rows and culums. i dont know how to delete empty rows and colums
i have data with balnak rows and colums. i want to delete all blank rows and culums. i dont know how to delete empty rows and colums
D D. Dec 25, 2006 #2 use a code like this to delete blanks rows Sub DeleteBlankRows1() 'Deletes the entire row within the selection if the ENTIRE row contains no data. Dim i As Long With Application ..Calculation = xlCalculationManual ..ScreenUpdating = False For i = Selection.Rows.Count To 1 Step -1 If WorksheetFunction.CountA(Selection.Rows(i)) = 0 Then Selection.Rows(i).EntireRow.Delete End If Next i ..Calculation = xlCalculationAutomatic ..ScreenUpdating = True End With End Sub
use a code like this to delete blanks rows Sub DeleteBlankRows1() 'Deletes the entire row within the selection if the ENTIRE row contains no data. Dim i As Long With Application ..Calculation = xlCalculationManual ..ScreenUpdating = False For i = Selection.Rows.Count To 1 Step -1 If WorksheetFunction.CountA(Selection.Rows(i)) = 0 Then Selection.Rows(i).EntireRow.Delete End If Next i ..Calculation = xlCalculationAutomatic ..ScreenUpdating = True End With End Sub
S Sandy Mann Dec 25, 2006 #3 If you mean all the rows below and columns to the right of your data then you cannot - Excel will just replace them. You can hide them by selecting the rows that you want to hide and the selecting Format > Rows > Hide and columns by Format > Columns > Hide. If it is odd rows or columns within the data then select the row or column and then delete it with Edit > Delete. -- HTH Sandy In Perth, the ancient capital of Scotland and the crowning place of kings (e-mail address removed) (e-mail address removed) with @tiscali.co.uk
If you mean all the rows below and columns to the right of your data then you cannot - Excel will just replace them. You can hide them by selecting the rows that you want to hide and the selecting Format > Rows > Hide and columns by Format > Columns > Hide. If it is odd rows or columns within the data then select the row or column and then delete it with Edit > Delete. -- HTH Sandy In Perth, the ancient capital of Scotland and the crowning place of kings (e-mail address removed) (e-mail address removed) with @tiscali.co.uk
T Tim Lindsley Dec 26, 2006 #4 If you don't want to use VBA, you could select the entire row/column and Edit-->Go To-->Special-->Blanks-->Edit-->Delete-->Entire Row/Column. Tim
If you don't want to use VBA, you could select the entire row/column and Edit-->Go To-->Special-->Blanks-->Edit-->Delete-->Entire Row/Column. Tim